Hacker News new | ask | show | jobs
by memoryperson10 838 days ago
Wild, I was just thinking about how I wanted to do reflection on C structs using LuaJIT FFI for serialization.
1 comments

It'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.