Luau, embedded in Rust.
Rustia runs Luau scripts in Rust applications. Edit the Luau below to change what the garden draws.
The garden is an example of embedding Luau in Rust. The website handles the animation and drawing. Rust calls your script each frame, and sprite() hands a drawing request back to the website.
Rustia features
- Hot reload
- Try script edits while your Rust app keeps running. If a module fails to install, the app can keep using the previous version.
- Deterministic execution
- Replay recorded inputs or reproduce a bug in the browser. In deterministic mode, the same script, seed, and inputs give the same results on native and WebAssembly.
- Pure Rust runtime
- Embed the same Luau interpreter on desktop and in the browser. Building the runtime requires no C++ toolchain.
- Rust functions and objects
- Expose the functions and objects your scripts need. Use Serde to read Luau tables into Rust structs.
- Script execution limits
- Set a budget for instructions and VM memory so a runaway script returns an error to your app.
- Experimental LLVM compilation
- We’re exploring compiling Luau to native code ahead of time to reduce the cost of running scripts.
How Rustia compares
Compare Luau runtimes by platform and workflow, and see how Rustia performed alongside other scripting options for Rust.
Luau runtimes
Capability snapshot checked 20 November 2026. Under Replay, Tested means native and browser results matched. Controls means the host can fix the seed and clock. A dash means the linked sources did not establish support.
| Project | Engine | Desktop | Browser Wasm | Hot reload | Replay |
|---|---|---|---|---|---|
| Rustia | Rust | Linux macOS Windows 1 | Demo | Rollback | ✓ Tested |
| luaur | Rust | Linux macOS Windows 2 | Playground | Run code | — |
| ulua | Rust | Linux macOS Windows 3 | Playground | Run code | — |
| ruau | Rust | Linux 4 | — | Reload module | ◐ Controls |
| luau-rs/luau | Rust | Linux 5 | CI tests | Run code | — |
| mlua | Upstream Luau (C++) | Linux macOS Windows 6 | Build | Replace module | — |
| Lune | Upstream Luau (C++) | Linux macOS Windows 7 | — | Load script | — |
Luau comparison sources and notes
Runtime speed
Microseconds per work unit (lower is better). Best observed steady-state interpreter times on Linux x86-64 on 2026-10-22 UTC. The measurements cover scripts already running. Each engine uses its own version of the workload.
| Work unit | Rustia | mlua + Luau | Koto | Rhai |
|---|---|---|---|---|
| Build, sum, and sort a 256-item array | 51.657 | 18.919 | 262.217 | 313.191 |
| Fill and read 128 hash entries | 87.555 | 22.485 | 146.082 | 348.085 |
| One closure call updating a captured value | 0.197 | 0.051 | 0.346 | 1.478 |
| Custom, keyed, and array iteration pass | 14.035 | 4.170 | 7.391 | 9.566 |
| Math library calls and buffered appends | 1.421 | 0.237 | 1.536 | 3.174 |