lua-users home
lua-l archive

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


On Mon, 19 Jan 2015 16:03:16 +0100
Philippe Lhoste <PhiLho@GMX.net> wrote:

> 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
> > internals
> > - 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.

I meant binary data in strings.
 
> License is the zlib/libpng one, a simpler derivative of the BSD license.
> 
> http://bazaar.launchpad.net/~philho/+junk/Lua/view/head:/DumpObject.lua

Thank you, added to my testbed. 
This one gives nice output.

- Timm

-- 
Timm S. Mueller <tmueller@schulze-mueller.de>
Schulze & Mueller GbR, Jungstr. 2, 10247 Berlin,
Gesellschafter: Franciska Schulze, Timm S. Mueller,
Tel. +49 30 85610000, http://www.schulze-mueller.de/