{"id":51091268,"url":"https://github.com/samyeyo/clx","last_synced_at":"2026-06-24T02:04:11.047Z","repository":{"id":364829574,"uuid":"1269130453","full_name":"samyeyo/clx","owner":"samyeyo","description":" A cross-platform ahead-of-time Lua compiler and runtime, using C++20 backend","archived":false,"fork":false,"pushed_at":"2026-06-14T16:38:55.000Z","size":2389,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-14T18:16:40.118Z","etag":null,"topics":["aot-compiler","c-plus-plus-20","compiler","lua","luajit","native","transpiler"],"latest_commit_sha":null,"homepage":"https://samyeyo.github.io/clx","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/samyeyo.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-14T10:44:03.000Z","updated_at":"2026-06-14T16:59:55.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/samyeyo/clx","commit_stats":null,"previous_names":["samyeyo/clx"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/samyeyo/clx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyeyo%2Fclx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyeyo%2Fclx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyeyo%2Fclx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyeyo%2Fclx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samyeyo","download_url":"https://codeload.github.com/samyeyo/clx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samyeyo%2Fclx/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34713807,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aot-compiler","c-plus-plus-20","compiler","lua","luajit","native","transpiler"],"created_at":"2026-06-24T02:04:10.401Z","updated_at":"2026-06-24T02:04:11.040Z","avatar_url":"https://github.com/samyeyo.png","language":"C++","funding_links":["https://ko-fi.com/samirtine"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"www/img/clx-logo-dark.png\"\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"www/img/clx-logo-light.png\"\u003e\n  \u003cimg alt=\"CLX Logo\" src=\"doc/img/clx-logo-light.png\" width=\"300\"\u003e\n\u003c/picture\u003e\n\u003cbr /\u003e\u003cbr /\u003e\n\nCross-platform ahead-of-time Lua compiler\n\n![Lua 5.5](https://img.shields.io/badge/Lua-5.5-E65100?logo=lua\u0026logoColor=white)\n![C++20](https://img.shields.io/badge/C%2B%2B-20-1565C0?logo=cplusplus\u0026logoColor=white)\n![License: MIT](https://img.shields.io/badge/license-MIT-4CAF50?logo=opensourceinitiative\u0026logoColor=white)\n[![ko-fi](https://img.shields.io/badge/Ko--fi-Support%20me-FF5E5B?logo=kofi\u0026logoColor=white)](https://ko-fi.com/samirtine)\n\n\u003c/div\u003e\n\u003cbr /\u003e\u003cbr /\u003e\n\nclx is a cross-platform ahead-of-time Lua compiler and runtime that generates standalone native executables through modern C++ toolchains.\nclx is not trying to be the fastest Lua implementation in every workload.\n\nIts goal is to provide:\n- ahead-of-time native compilation,\n- deployable standalone executables,\n- predictable runtime performance,\n- fast startup times,\n- integration with existing C++ toolchains,\n- and strong optimization opportunities through modern native compilers.\n\n## Quick Start\n\n```bash\ngit clone https://github.com/clxcompiler/clx.git\ncd clx\n./build.sh install       # or build.bat install on Windows\nclx examples/hello/hello.lua\n./hello\n\nHello clx !\n```\n\n## Features\n\n- **Competitive performance** with strong results on many AOT-friendly workloads\n- **No bytecode interpreter overhead** — compiles to standalone native executables\n- **Aggressive optimizations** — leverages modern optimizations via Clang/GCC/MSVC\n- **Small binaries** — size-oriented builds can produce very compact executables (Lua programs can be under 100 KB with `--minimal`)\n- **Targets Lua 5.5 compatibility** — coroutines, metamethods, tables, and more\n- **NaN-boxed** value representation\n- **Inline string** optimization (strings ≤ 5 bytes stored in value, no allocation)\n- **Fast-path** table access caches\n- **Lightweight** AOT-oriented runtime\n- **clx C++ API**: develop portable native modules using a value-oriented API\n\n## Project status\n\nclx is currently in beta.\nThe compiler is already capable of compiling non-trivial Lua applications, but compatibility work and optimization improvements are ongoing.\n\n## Example projects\n\n- Hello World (minimal executable)\n- Mandelbrot Viewer (graphics demo)\n- Pong (complete game built in Lua)\n- Sokol Module (native graphics module using the clx C++ API)\n\n## Requirements\n\n- **Linux**: `clang++` or `g++`\n- **macOS**: `clang++` (Xcode)\n- **Windows**: `clang++` (LLVM) or MSVC\n- **CMake 3.15+** for building\n\n\u003e **Tip**: Clang is recommended for best performance. It enables advanced optimizations that produce the fastest executables.\n\n## Build\n\n### POSIX\n\n```bash\n./build.sh              # Release (default)\n./build.sh debug        # Debug\n./build.sh clean        # Removes build/ + /usr/local install\n./build.sh install      # Release + install to /usr/local\n./build.sh uninstall    # Removes installed files in /usr/local\n```\n\n### Windows\n\n```bash\n./build.bat              # Release (default)\n./build.bat debug        # Debug\n./build.bat clean        # Removes build/ + ./bin and ./lib\n./build.bat install      # Release + install to /bin and ./lib\n./build.bat uninstall    # Removes previously installed clx\n```\n\nAlso works directly with CMake:\n\n```bash\nmkdir -p build \u0026\u0026 cmake -S . -B build \u0026\u0026 cmake --build build\n```\n\nOnce compiled, you will find :\n\n- `build/clx` — The compiler executable\n- `build/libclx.a` — Static runtime library\n- `build/libclx_size.a` — Static runtime library optimized for size\n\n## Usage\n\n```bash\n./build/clx file.lua                         # Compile to executable (default flags)\n./build/clx --object file.lua                # Object file (.o/.obj)\n./build/clx --static file.lua                # Static clx module (.a/.lib)\n./build/clx --cpp file.lua                   # Generate C++ source, don't compile\n./build/clx file.lua -O2                     # Forward unknown clx flags to the backend compiler\n./build/clx file.lua --output f.exe          # Custom output name\n./build/clx file.lua --debug                 # No optimizations, debug symbols\n./build/clx file.lua --minimal               # base + package modules only\n./build/clx file.lua --fast                  # Optimize for speed\n./build/clx file.lua --size                  # Optimize for size (default)\n./build/clx --version                        # Print version\n./build/clx --help                           # Display help\n```\n\n#### Compatibility\n\nclx targets Lua 5.5 compatibility.\n\nCurrent status:\n\n- Core language: largely implemented\n- Tables and metatables: implemented\n- Coroutines: implemented\n- Modules: implemented\n- Most standard libraries: implemented\n\nSee **[compatibility.md](doc/compatibility.md)** for detailed status.\n\n#### Known limitations\n- **`load()` / `dofile()` / `loadfile()` / `string.dump()`** — dynamic code loading requires a runtime interpreter\n- **`debug` module** — very complex in a pure AOT model\n- The traditional Lua C API is not supported.\n- Binary modules should be written using the clx C++ API.\n\n## Test suite\n\n```bash\n./tests/run.sh              # POSIX\n./tests/run.bat             # Windows\n```\nEach `.lua` in `tests/` is compiled to a binary and executed. Tests print `[OK]`/`[FAIL]` per assertion.\n\n## Benchmarks\n\nResults are expressed in speedup factor against standard Lua 5.5 interpreter :\n\n| Script | lua 5.5 | LuaJIT | clx `--fast` |\n|--------|---------|--------|--------------------------|\n| fib.lua | 0.293s (1.00x) | 0.048s (6.10x) | **0.006s (48.83x)** |\n| arraysum.lua | 0.110s (1.00x) | 0.044s (2.50x) | **0.023s (4.78x)** |\n| spectralnorm.lua | 0.303s (1.00x) | **0.018s (16.83x)** | 0.040s (7.57x) |\n| canada.lua | 0.450s (1.00x) | **0.148s (3.04x)** | 0.231s (1.95x) |\n| warmup.lua | 0.006s (1.00x) | 0.008s (0.75x) | **0.003s (2.00x)** |\n\n\u003e Measured on Intel® Core™ i5 Ultra 125U CPU @ 4.30GHz · Linux · GCC 13.3.0 · Avg of 10 runs\n\n\u003e Full benchmarks are available in **[clx benchmarks](./doc/benchmarks.md)**\n\n## Documentation\n\nDocumentation is available in the `doc/` directory, including :\n\n- Getting Started\n- CLI Reference\n- Compatibility Status\n- Module Development Guide\n- C++ API Reference\n- Runtime Internals\n- Architecture Overview\n- Benchmarks\n\nSee **[Documentation Index](./doc/index.md)**\n\n## License\n\nclx is MIT Licensed — Copyright (c) 2026 Tine Samir\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyeyo%2Fclx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamyeyo%2Fclx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamyeyo%2Fclx/lists"}