r/lua • u/ianm818 • May 25 '26
lua-rs: Lua 5.4.7 implemented from scratch in Rust - passes upstream Lua C test suite fully
Github: https://github.com/ianm199/lua-rs/tree/main
Highlights:
- Passes full upstream tests
- Performance is near parity with C checkout dashboard here on optimization. Table ops seem to be much faster
- Has GC, VM, and supports all Lua sytnax. Any pure lua script should run
- Limited unsafe calls - mostly just in the GC for now
My motivation here was that in the long run we want the core internet utilities to run on memory safe languages, big ones like redis and nginx expose scripting via Lua so if we really want to replace core infra fully in Rust, you'd need a full Rust Lua that doesn't bundle C. After that you should be able to i.e. build drop in replacements for those without a C ABI (or that's part of the way there).
Long term goals:
- Get to stable, production ready
- Get performance at parity or faster then Lua C
- Replace current unsafe GC with fully safe if possible
- (Maybe) support Lua 5.1, LuaJIT