lua-users home
lua-l archive

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


> Later today Roberto will do a Q&A (Or perhaps a AMA) - So if you have
> burning questions for Roberto, this is your time to ask them, either on
the list
> or directly to me. I will redirect your questions to Roberto.

Does he consider ever separating associative types from array/list types,
or at least adding or advocating for a standard way to flag a type as a
list?

Or, more pragmatically: how does he suggest the author of a language-agnostic
serialization library (JSON, MessagePack...) should handle serialization
of tables?

Currently we all have our inefficient detection routines and configuration
options
(eg. [1] or [2]) and even encoding something simple as this JSON is not
trivial:

    {"a":[],"b":{}}

The result is that as soon as we want to communicate with other languages
via APIs
the code becomes tricky and full of special cases.

So the question was: does he intend to solve this at the language level,
and if not
should we write libraries that expect type() to be overridden with e.g.
"map" or "array"?

Sorry I couldn't attend the Workshop to ask this in person ;)

[1]
https://github.com/fperrad/lua-MessagePack/blob/master/src/MessagePack.lua#L144
[2]
http://www.kyne.com.au/~mark/software/lua-cjson-manual.html#encode_sparse_array

-- 
Pierre Chapuis