A developer built a Lua compiler that turns scripts into native executables without a Lua VM
Trials and Tribulations of Native Lua Compilation
After years of embedding Lua, the author of clx wanted to go beyond packaging a VM inside an executable. clx parses Lua 5.5, generates C++, and compiles it with Clang, GCC, or MSVC, producing native code backed by a purpose-built runtime for tables, strings, GC, and coroutines. Modules, native C++ bindings, and static libraries all work, with an optional --dynamic mode for runtime-loaded scripts. The hard part wasn't code generation but preserving Lua's semantics.
The individual pieces are manageable, but making all of them behave correctly together is where the real work is.