lua-users home
lua-l archive

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


Adam Strzelecki wrote:
> Started peeking in LuaJIT code. I wonder if there are any
> caveats in thinking that GCproto serialization/deserialization
> is sufficient to mimic "luac" compilation - dumping BC,
> constants and variable info into binary file with some own
> LuaJIT signature, i.e. "\033LJ2".
> 
> Seems to me that GCproto is pretty self-contained having all
> necessary information about script. What's not clear to me is
> how to encode constants, especially whether they are just simple
> types, or tables too.

Well, it's not that easy because the constants may contain nested
GCproto objects or template tables holding more constants. And
you'll need to intern some constants upon deserialization, but not
others. The VM probably needs some changes to handle loading
bytecode efficiently. Haven't looked into this in detail.

--Mike