lua-users home
lua-l archive

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

2009/5/27 可可熊 <>:
> 2009/5/27 Jerome Vuarand <>:
>> I'm proud to announce the public release of Lunary, a deserialization
>> library. It is available on its website:
>> (mirror)
>> Here is a little introduction:
>>  Lunary is a framework to read and write structured binary data from
>>  and to files or network connections. The aim is to provide an easy to
>>  use interface to describe any complex binary format, and allow
>>  translation to Lua data structures. The focus is placed upon the
>>  binary side of the transformation, and further processing may be
>>  necessary to obtain the desired Lua structures. On the other hand
>>  Lunary should allow reading and writing of any binary format, and
>>  bring all the information available to the Lua side.
>> Everything else, including download links, is explained on the website.
>> To compare it to existing struct libraries, that one is intended to be
>> higher level (actually I use an existing struct library for some low
>> level serialization). It can be used to load complex binary files
>> several tens or hundreds of megabytes long in a single operation without
>> problem.
> Like struct pack in Python?

The existing Lua struct libraries [1][2][3] are very similar to the
Python one [4]. My library however takes a higher level approach where
you define named data types, and can combine them in complex manners.
While struct libraries are perfectly fine to describe C structures
containing only POD value, they are not capable of describing complex
file formats or network packets. This is where Lunary shines.