Hacker News new | ask | show | jobs
by spc476 3339 days ago
I did write a Lua binding to TCC [1] and used that to write a Lua module to load Lua modules written in C directly from source code [2], which I used in an older version of my JSON decoder [3], which contains the C code embedded right in the Lua source code.

On the down side, TCC doesn't support all the architectures I use, so I mostly use it for proof-of-concept and throw away code.

One thing I keep thinking is to possibly use TCC (or parts of it) to parse C header files directly, so it would be easier to use an FFI in Lua.

[1] https://github.com/spc476/lua-conmanorg/blob/master/src/tcc....

[2] https://github.com/spc476/lua-conmanorg/blob/master/lua/cc.l...

[3] https://github.com/spc476/LPeg-Parsers/blob/json-1.0.0/json....