If I understand your problem correctly, you want to use Lua simply to avoid having to serialize the data (depending on the file and from the file, I suppose). If so, you can use Lua for this, but for me it is a bit overwhelming.
Answering your last question, Lua will get more memory than native C, and will run slower (Lua VM is slower than native C, and even if you use only C to manipulate “jumps” from Lua to C and Viceversa will have a penalty as a lot of pushing and popping to / from the Lua stack).
If you want to simplify time serialization, it might be better to use a library that serializes to / from C directly. For example, json .
source share