Serialization is a hornets nest. I’ve watched literally dozens of well-intentioned attempts and they all ended in major grief (see Jave for a classic example of the mess). There are numerous problems all of which appear deceptively simple to solve:
— How to identify the de-serializer for each type (and avoid collisions)?
— What happens if a de-serializer is missing?
— How to handle different versions (that is, as the formats and pack/unpack code evolves over time)?
— How to handle (and *who* handles) recursive structures and containers?
— If you serialize as binary, how to handle different representations on different platforms
— If you serialize as text, how to handle encoding, particularly for edge cases (e.g. NaN, non-exact floating point as decimal etc etc)
.. and there are many others. Several of our major projects *do* share a common serialization format, but it’s strictly Lua-to-Lua so we can make some assumptions because we carefully restricted the usage domain.
An __serialize standard isn’t going to help unless it can be plugged into a framework that has answered the above issues imho.