[ANN] CLX - Ahead-of-Time Lua 5.5 Compiler
Hello,
CLX is a new open-source ahead-of-time compiler for Lua 5.5.
CLX compiles Lua source code to standalone native executables through modern C++20 toolchains (Clang, GCC, and MSVC).
Current features include:
- Native standalone executable compilation
- Support for most Lua 5.5 language features
- Cross-platform support (Linux, Windows, and macOS)
- Lightweight runtime designed for AOT compilation
- C++ API for native modules
- Example projects (a fully playable Pong game and a Mandelbrot fractal renderer)
Recent benchmarks show consistent speedups over the standard Lua interpreter and competitive performance with LuaJIT on a number of workloads.
The project is currently in beta and feedback is welcome.
Website:
https://samyeyo.github.io/clx
GitHub:
https://github.com/samyeyo/clx
Although I am also the author of LuaRT, CLX is a completely independent project with a different architecture and different goals.
Thank you,
Samir Tine
28
Upvotes
2
u/suhcoR Jun 22 '26
The Are-we-fast-yet benchmark suite is available for Lua (I usually use this version: https://github.com/rochus-keller/Are-we-fast-yet/tree/main/Lua, and here are some results: http://software.rochus-keller.ch/are-we-fast-yet_Lua_results_2024-06-20.pdf) and it would be interesting to see what overall performance you get with your cross-compiler.
1
u/Additional_Ad6385 Jun 21 '26
This is cool! Did you consider using LLVM's backend?
1
u/dandy_kulomin Jun 21 '26
Cool! How do you represent tables in C++? Are they just some kind of hashmap with string keys? When I think of Lua performance this is probably something that will not match static C++ typed code, no?
1
u/weregod Jun 22 '26
1
u/Brave_Bicycle_4724 Jul 03 '26
I liked your project. Does it already have the library or is it still in development?
How many kilobytes or megabytes does it weigh?
Will it take long to be complete?
1
u/Old_County5271 Jun 22 '26
The website is an unreadable small window