lua-users home
lua-l archive

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

On 14/01/2015 13:51, Timm S. Mueller wrote:
before I'm starting to write my own, I'm looking for a serialization
and deserialization library. Requirements:

- must cover Lua 5.1, 5.2, 5.3 and LuaJIT
- in the MIT/BSD/CC/PD license department
- must cover cyclic references and binary data
- preferrably written in C for performance, Lua would be fine also
- should only use official Lua APIs, no outside dependencies, no state
- The transport format should be legal Lua, but this isn't strictly a
requirement and may be sacrificed if the result can be transported,
preferrably also between different architectures and Lua versions. I'm
not objecting to using JSON format either.

Not required: Userdata, metatables, functions and upvalues. A small
footprint and the ability to operate on a writer/readers would be nice.
Any ideas, recommendations?

Some years ago, I wrote my own function for this.
It doesn't support... precisely what you rule out, so it should be OK for you.
It does have the small footprint, covers cyclic references, is pure Lua, so it might still work in recent versions of Lua...
Not sure what you mean by "cover binary data" if you don't require to support userdata.
If that's "binary data in string", you can just add something changing control chars to their escapes to the string serializations.

License is the zlib/libpng one, a simpler derivative of the BSD license.

Philippe Lhoste
--  (near) Paris -- France
--  --  --  --  --  --  --  --  --  --  --  --  --  --