Clx is a cross-platform ahead-of-time Lua compiler and runtime that generates standalone native executables through modern C++20 toolchains [1]. The project started as an experiment to see whether modern C++ could be used as a portable compiler backend instead of LLVM or direct machine code generation [2]. Clx targets Lua 5.5 compatibility and provides competitive performance with strong results on many AOT-friendly workloads [3]. The compiler is already capable of compiling non-trivial Lua applications, but compatibility work and optimization improvements are ongoing [4].
Clx comes with examples, including a Pong game and a Mandelbrot viewer, that demonstrate native desktop application development with standard Lua code [5]. The compiler used to build Clx is fixed at build time via CMake and used for all Lua script compilation, ensuring ABI compatibility between the runtime libraries and generated code [6]. Clx is MIT Licensed and has a growing community of contributors [7].
Sources
- https://github.com/samyeyo/clx
- https://news.ycombinator.com/item?id=48871547
- https://www.reddit.com/r/lua/comments/1ubt4e0/ann_clx_aheadoftime_lua_55_compiler/
- https://github.com/samyeyo/clx/blob/main/README.md
- https://github.com/samyeyo/clx/tree/main/examples
- https://github.com/samyeyo/clx/blob/main/CMakeLists.txt
- https://github.com/samyeyo/clx/graphs/contributors


