lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


That's right, it's out of beta! 1.0.x is now feature complete;
everything else is just bugfixing, and I'm starting work on 1.1.

You may be wondering why 1.0 was never announced. Well, shortly after I
pushed it and on the day I was going to announce it, sanooj reported
some serious bugs in the floating point handling. He also contributed a
set of floating point tests which are now available as tests/fp-*.lua;
these were invaluable in fixing said bugs. Props.

We now return you to your regularly scheduled announcement email.

	What is it?
A library for packing and unpacking binary data, not unlike lhf's lpack
or Roberto's struct library. It is written in pure Lua and supports a
wide variety of data types and several advanced features. (It doesn't
support bitpacks yet, but that's in for 1.1.)

	Why use it?
- read and write support for signed and unsigned integers, fixed point
rationals, fixed-length, null-terminated, null-padded & counted strings,
skipping and padding, booleans, floats, and bitmasks
- unpack/pack from/to strings, files, or anything that supports
file-like :read/:write/:seek operations
- any type can be any byte-aligned width - 24-bit integers? booleans
stored as uint32_ts? 128-bit masks? No problem.
- supports naming, grouping and repetition of fields (and groups, nested
arbitrarily deep). You can specify the structure of the data in the
format string and get back a table with conveniently named fields (and
possibly subtables); and then you can unpack an array of 10,000 of them
just by putting "* 10000" on the end.
- written entirely in Lua, and thus very portable and easy to extend.

	Why NOT use it?
- written entirely in Lua, and thus slower and more memory-hungry than C
equivalents
- no support for bit-aligned fields (yet) - all fields must be byte aligned

    Who wrote it?
- Peter Cawley (Corsix) contributed the original floating point module,
which the current one is based on.
- M Joonas Pihlaja (sanooj) contributed a huge amount of testing and
numerous bug reports, of which the floating point bugs mentioned above
are only the most recent; without his constant prodding this library
would probably never have seen release.
- The rest of it was written by me, Ben Kelly (ToxicFrog).

    What's planned for 1.1?
- bitfield support

	Where is it?
The project is available via github at:
	http://github.com/ToxicFrog/vstruct
The latest release can be downloaded from:
    http://github.com/ToxicFrog/vstruct/archives/v1.0.1
And the README:
http://github.com/ToxicFrog/vstruct/blob/f1af3eda6bf346aa884b48a5b62a28d0783f1c23/README