Replies: 1 comment
-
Regarding point 1, compiling with luau gives you a vec of u8s. To load it, just set mode to chunk mode binary. regarding point 2, deserializing a lua value needs a lua vm argument so it’s not easy to just add deserialize imo. Also, it is a logic error to try serdeing a function as well as the computed bytecode is not stable across luau releases and may have upvalues as well (also, how do u serialize userdata) |
Beta Was this translation helpful? Give feedback.
-
I'm looking into using the serde functionality to pass data between Lua states. Ideally, I would want to be able to pass functions too. Seeing that luau's compiler supports writing to bytecode, would it be possible to have that serialized, for example, into a binary format? I haven't found how to run the compiled bytecode though.
Additionally, many compact formats such as bincode rely on types implementing Deserialize. Is there a technical reason or limitation why the Lua types do not implement Deserialize?
Beta Was this translation helpful? Give feedback.
All reactions