lua-users home
lua-l archive

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

On Tue, Nov 10, 2009 at 12:44, Wesley Smith <> wrote:
> I'm sure everyone on this list has written a table serializer at some
> point.  Here's mine:

And here are ours (from not-yet-released Lua library lua-nucleo):

-- tstr to print data to user (does not support recursive tables,
"corrupts" non-serializable types by converting them to human-readable

-- tserialize to serialize data for computer consumption. It is less
readable, relatively slower, but supports recursive tables

If you need multiline output, we have tpretty() in the works... but it
is not ready yet. :-)

These implementations are quite fast (at least according to my humble
benchmarks). If you see faster pure-Lua serializer / dumper with
comparable features, please tell me :-)