ulua is a pure-Rust implementation of the Luau language (Roblox's typed Lua derivative), covering the lexer, parser, bytecode compiler, register VM, garbage collector, bidirectional type inferencer, and A64/X64 native JIT code generation.
Current focus:
We are actively refactoring transliteration artifacts from earlier C++ ports, eliminating raw pointers, removing warning suppressions, and shrinking unsafe boundaries. Systematic microarchitectural tuning will follow once idiomatic Rust patterns are stabilized.
In-Memory Benchmark Comparison:
Tested 16 compute-heavy benchmarks in a single process on Apple Silicon (M2 Max, arm64), taking median runtimes in milliseconds (ms):
- Interpreter: ulua tracks upstream C++ Luau throughput (1.0 vs 1.02 GeoMean) and is ~17% faster than Lua 5.4.
- JIT: native compilation cuts runtime by ~48% (0.52 GeoMean), matching C++ Luau JIT (0.57).
WebAssembly Playground:
Without C/C++ build dependencies, ulua compiles directly to wasm32. A live browser playground is running client-side at https://webc-site.github.io/ulua
Quick example:
use ulua::prelude::*;
fn main() -> Result<()> {
let lua = Lua::new();
lua.load("print('Hello from ulua')").exec()?;
#[cfg(feature = "jit")]
{
lua.enable_jit(true)?;
let res: i64 = lua.load("local s = 0; for i = 1, 1000 do s += i end; return s").eval()?;
assert_eq!(res, 500500);
}
Ok(())
}
GitHub: https://github.com/webc-site/ulua Playground: https://webc-site.github.io/ulua crates.io: https://crates.io/crates/ulua
ulua is a pure-Rust implementation of the Luau language (Roblox's typed Lua derivative), covering the lexer, parser, bytecode compiler, register VM, garbage collector, bidirectional type inferencer, and A64/X64 native JIT code generation.
Current focus: We are actively refactoring transliteration artifacts from earlier C++ ports, eliminating raw pointers, removing warning suppressions, and shrinking unsafe boundaries. Systematic microarchitectural tuning will follow once idiomatic Rust patterns are stabilized.
In-Memory Benchmark Comparison: Tested 16 compute-heavy benchmarks in a single process on Apple Silicon (M2 Max, arm64), taking median runtimes in milliseconds (ms):
- Interpreter: ulua tracks upstream C++ Luau throughput (1.0 vs 1.02 GeoMean) and is ~17% faster than Lua 5.4. - JIT: native compilation cuts runtime by ~48% (0.52 GeoMean), matching C++ Luau JIT (0.57).WebAssembly Playground: Without C/C++ build dependencies, ulua compiles directly to wasm32. A live browser playground is running client-side at https://webc-site.github.io/ulua
Quick example:
[flagged]