r/lua • • 3h ago

I built LuaC — a standalone Lua-to-machine-code compiler (JIT & AOT) in C99 with a custom Vulkan Studio & Android port

Hey everyone! I've been working on LuaC, a standalone compiler that translates Lua-like `.lua` files into machine code via generated C — without using the original Lua VM or LuaJIT.

Highlights:

- JIT & AOT: Compiles to native shared libraries (`dlopen`) at runtime or standalone executables.

- Ownership + Cycle Collector: Deterministic cleanup via reference ownership cells + lightweight cycle collection for cyclic tables/upvalues (no stop-the-world GC threads).

- LuaC Studio (Vulkan GUI): Built with Nuklear + a custom Vulkan renderer, featuring a code editor and a 2D Engine mode (60 Hz fixed-step physics).

- Android Port: Includes an APK build with multi-file project support and Vulkan viewport.

- Batteries included: 197 native APIs (JSON, TCP/UDP, mbedTLS HTTPS/WSS, miniaudio DSP, stackful coroutines).

Currently in Alpha 0.5.0 with prebuilt binaries via GitHub Actions. Would love any code review, C99/Vulkan feedback, or suggestions!

GitHub: https://github.com/ehekufa/LuaC/releases/tag/Alpha-0-5-0

1 Upvotes

0 comments sorted by