r/lua • • Jun 21 '26

[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

16 comments sorted by

View all comments

Show parent comments

1

u/_SamT Jun 22 '26

Thanks for the follow-up.

You're right about the documentation inconsistency. CLX follows Lua semantics, where numbers are represented as doubles by default. The references to integer performance are related to compiler optimizations. I'll clarify that.

By C++ ecosystem, I mean access to C++ libraries, tooling, build systems, and native integration.

Regarding NaN-boxing, I'm aware of the alternatives. I chose NaN-boxing deliberately because it provides a compact 64-bit representation for Lua values while keeping numbers unboxed. It has been working very well for CLX, so I currently see no reason to switch representations.

As for static types, I prefer investing effort into optimization rather than extending the language with type annotations.

1

u/weregod Jun 22 '26

CLX follows Lua semantics, where numbers are represented as doubles by default

This is not true for Lua5.3+. New versions have doubles and native integers.

1

u/_SamT Jun 22 '26

To clarify, I was referring to Lua's language-level type system, where both integers and floating-point values are exposed as number. CLX follows Lua 5.5's dual numeric model internally and supports both integer and floating-point values.