Lua-to-Native Compilation via C++20
I stumbled onto clx, which takes a completely different approach. Instead of using a traditional backend like LLVM, it acts as an ahead-of-time (AOT) compiler that translates standard Lua code directly into C++20. This means the actual heavy lifting of machine code generation is offloaded to the host's existing toolchain—whether you're running GCC, Clang, or MSVC. It essentially turns your Lua scripts into standalone native executables.
The technical shift in the latest update is actually quite impressive. They moved away from the old NaN-tagged value representation to a shadow-types implementation and added full int64 support. For anyone working on math-heavy logic, the improved native arithmetic code generation is a huge deal. They even managed to bake in ARM64 macOS coroutine support, which is rare for these kinds of niche compilers.
In my initial testing, the performance isn't just "better than an interpreter"—it's actually outperforming LuaJIT on specific computational workloads. Since it's fully AOT compiled, you don't deal with the unpredictable latency spikes that can sometimes plague JIT engines in a production environment. It even includes some graphical demos like a Mandelbrot explorer using a Sokol binary module to show off the C++ API integration.
If your team is struggling with the performance overhead of scripting languages but wants to keep the ease of Lua development, this workflow might actually be viable for your build pipeline.
https://github.com/clx-lang/clx