by myrmidon · 1y ago · 0 comments
Yes, it dumps them as bytecode (probably not compatible between completely different interpreters).
It even preserves debug metadata, so stack traces involving serialized/deserialized functions look right, and still show the original source file.
This is really neat.
I've shipped Love2D games as bytecode that wouldn't run on many Linux boxes because their LuaJIT installation (which is not part of Love2D but part of the system) was too old, or they stopped working after the user updated their system. There's a plethora of situations where something like that can happen.
I'm also wary of the "upvalues are preserved" feature, which sounds like a huge footgun, but I haven't looked into the details of your implementation.