3 ms·
Wild, I was just thinking about how I wanted to do reflection on C structs using LuaJIT FFI for serialization.
by memoryperson10 3y ago
Wild, I was just thinking about how I wanted to do reflection on C structs using LuaJIT FFI for serialization.
- JonChesterfield 3y agoIt's worth considering the other direction - write the struct definition in json or xml, or dicts in python source or whatever, and generate the C structs and the associated functions and data from that. Go slightly further and write out function types like that and you get something equivalent to swig, where instead of parsing C and trying to emit wrappers for other languages from that framework, you have the data in native lua tables that you emit code from.