lua-users home
lua-l archive

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

- Portable output; the ability to save a collection of Lua values on a
   32-bit PowerPC and load them on a x86_64 machine would be nice.
   (Note, I will likely need some help thinking of ways to store certain
   things portably.)
Which things exactly? I'm writing a parser to a data description language which generates the description in binary form, along with an API to query the constructs defined in the binary.

The binary output is big endian, and I just store a value in big endian in the header which can be queried to check if the endianess of the binary data and of the machine using the API match. If they don't, I swap the endianess of all values as a first step prior to let the caller use the API.

I think that Pluto, being about serialization, doesn't need to correct the endianess a priori. It could just correct it as it deserializes data. As for serialization, it could serialize data in whatever endianess the machine uses, so long as the magic value is there and in the same endianess as the machine.