Why would you ever opt to go thru Lua in this case?
It's well supported, well maintained, and around for the foreseeable future. (OpenResty)
The language implementation is fast, and allows you to tap into any C-compatible library.
The question isn't why you would go through Lua, but why you would choose something with less support?
This doesn't seem to support actually exporting C-compatible functions.
Create some Lua code that runs within C? Rather than just passing and converting to C values when needed?
That's the role of the C API [0]. But usually you'd just be passing C up to Lua to bind it together.
Re:Nginx C function
by annchin_peh on Friday October 19, 2018 @04:47AM
(#18255167)
it's complicated
[0] https://luajit.org/ext_ffi.html