Interesting language


Nelua compiles to C first then to native code, thus you can...mix in other C code without costs, create or use C libraries, use C tools, and reuse the generated C code.

I wonder if this means it doesn't need bindings to interact with C code?

Sure looks that way:
 
I wonder if this means it doesn't need bindings to interact with C code?
I did expect to see the ability to inline C but it seems that is not the approach they have taken:

https://nelua.io/overview/#importing-c-functions-declared-in-headers

I do still intend to have a quick play with it because it is a little bit different to the usual bindings glue (and technical debt) generator approach by proxy of actually using C as intermediate.

I like Lua but it is a little too wasteful for many problem domains. LuaJIT is faster but possibly a little too unportable for many problem domains. This could be a good compromise. I also plan to explore how they have implemented the (optional) garbage collector too. In theory it could be the more effective tracing approach even with C.
 
I do still intend to have a quick play with it because it is a little bit different to the usual bindings glue (and technical debt) generator approach by proxy of actually using C as intermediate.
Well, I just had a look at it, those are typical FFI-style bindings (same thing as JNA and so on). One shortcut that compile-to-C toolchain allows is that constant values don't have to be provided: https://github.com/edubart/nelua-la...8a07c249de59a9dff3099495/lib/C/time.nelua#L48. It might or might not interoperate with C macros. Static linking is also easy with that approach.
 
Back
Top