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

  1. https://github.com/samyeyo/clx
  2. https://news.ycombinator.com/item?id=48871547
  3. https://www.reddit.com/r/lua/comments/1ubt4e0/ann_clx_aheadoftime_lua_55_compiler/
  4. https://github.com/samyeyo/clx/blob/main/README.md
  5. https://github.com/samyeyo/clx/tree/main/examples
  6. https://github.com/samyeyo/clx/blob/main/CMakeLists.txt
  7. https://github.com/samyeyo/clx/graphs/contributors