I’ve often felt great LuaJIT’s "just paste C declarations for FFI" was its greatest achievement. I tried to dig into the source code and port the C parser to Python, but it was beyond me at the time.
Still seems like a good idea that I hope someone will do.
It doesn't run the preprocessor, so you have to expose constants as externs, for example. Things like `int32_t` still work, so it must just have built in support for standard types.
It's by far the best FFI implementation in the industry across all languages. You can even setup a GCC workflow to automate the bindings by stripping information from headers.
I'm disappointed by the FFI experience everywhere else, it makes you feel like you're doing software development in the stone ages.
It's fantastic when embedding Lua in a self contained executable too! I have a routine that goes through and 'cdef's certain headers that were also #included at compile time. Super powerful extending a C program this way.
Still seems like a good idea that I hope someone will do.