Nelua: Ahead-of-time compilation of Lua-like language
Posted: Sat Dec 12, 2020 4:48 pm
Thanks to user neku, I have discovered this new compiler. It does not seem mature enough, but it's maybe interesting enough as to keep an eye on it for the future:
https://nelua.io/
The idea seems attractive. There are big pros and, unfortunately, huge cons. Still, it's something worth considering for integration into Löve as an alternative to LuaJIT, if that's possible.
The pros:
https://nelua.io/
The idea seems attractive. There are big pros and, unfortunately, huge cons. Still, it's something worth considering for integration into Löve as an alternative to LuaJIT, if that's possible.
The pros:
- Faster than LuaJIT, because it's not an interpreter.
- The output is C code, which compiles to a binary library or executable, therefore those who have concerns about sharing the source code will be happy with that. Also, it's immediately available everywhere where C is.
- It has a number of interesting features, e.g. making the garbage collector optional, and preprocessor/metaprogramming.
- It's more powerful for interfacing with external libraries; the downside is that it may also be more difficult.
- Generating multi-platform executables is far more difficult, because you need a cross-compiler for every target platform.
- It doesn't allow easily porting existing projects, because it currently lacks some essential Lua features, e.g. tables. This might change in future.
- There's nothing even resembling a Lua-compatible API, therefore integrating it into Löve is expected to take quite some work.
- It's WIP therefore not stable enough to use immediately.