clx - Cross-platform AOT Lua compiler for native executables

Show HN: Clx – Compile Lua to Native Executables Through C++20

clx - Cross-platform AOT Lua compiler for native executables

clx is a modern cross-platform ahead-of-time compiler that transforms Lua scripts into standalone native executables using a C++20 backend. Unlike traditional interpreters, clx eliminates bytecode overhead to deliver predictable performance, fast startup times, and aggressive optimizations via Clang, GCC, or MSVC. Ideal for developers seeking to deploy compact, high-performance Lua applications across Linux, macOS, and Windows without runtime dependencies, clx supports Lua 5.5 features while enabling native module integration through a lightweight C++ API.

clx is not trying to be the fastest Lua implementation in every workload. Its goal is to provide ahead-of-time native compilation, deployable standalone executables, predictable runtime performance, and fast startup times.
  1. valorzard

    Does the backend output c++20?

    If so, why? I’m curious what specific features you guys are using from c++20.

    Have c++20 coroutines been useful at all?

  2. corysama

    Anyone know if there’s still a community around https://github.com/snabbco/snabb ? This seems like something they would appreciate.

    Besides that, first use case that comes to mind is that gamedev likes Lua but iOS does not like LuaJit in JIT mode.

  3. 1vuio0pswjnm7

    FYI

    https://github.com/samyeyo/clx/releases/download/v0.2.0/clx-...

    Extracts to current directory instead of clx-linux-x86_64

  4. jxndbdbd

    Interesting project! I have not looked to closely at the source so forgive me for asking

    - Are you doing a source to source or byte code to source transformation?

    - How are you beating lua performance, since the naive implementation of a dynamic language would require tons of tables with pointer chasing

  5. skimmed_milk

    This is cool, it could be a neat way to get Love2d games on the web with wasm

More from this day

2026-07-16