rustia 0.2.0

Rustia is a pure-Rust interpreter for embedding standalone Luau in games and tools. Edit scripts without a rebuild and let players write mods. Rustia grew out of a game by Slowchop Studios that needed to script character decisions and replay them on desktop and in a browser.
Documentation
# Rustia and other Luau projects

## Lua and Luau

- **Lua provides** functions, tables for storing data, and coroutines that can pause and resume.
- **Luau adds** shortcuts like `score += 1`, `continue` in loops, and optional type annotations. Rustia runs annotated scripts without a static type check.

Rustia targets standalone Luau 0.709, including its vector and buffer libraries. Roblox services are outside that scope. [Tested language features](https://github.com/slowchop/rustia/blob/main/conformance/COVERAGE.md)

## What Rustia adds

- **Replay on desktop and in a browser.** In deterministic mode, the same script, seed, and inputs produce the same decisions. [Watch the native and Wasm race](https://github.com/slowchop/rustia#readme)
- **Keep running through a bad edit.** Try a new module while the app runs. If installation fails, Rustia restores the previous script state and your app can keep calling the old functions. [Hot reload example](https://github.com/slowchop/rustia/blob/main/crates/rustia/examples/hot_reload.rs)
- **Give each decision a budget.** Limit the work a script can do and the memory Rustia tracks for it. A script can queue changes for Rust and deliver them only when the call succeeds. [Runnable example](https://github.com/slowchop/rustia/blob/main/crates/rustia/examples/hardened_decision.rs)

## Compare Luau projects

All seven compile Luau to bytecode. ulua, mlua and Lune also offer a native JIT. For source-to-source transpilation or bundling, see [darklua](https://darklua.com/).

| Project | Runtime | Platforms | Hot Reload | Replay |
| --- | --- | --- | --- | --- |
| [**Rustia**](https://github.com/slowchop/rustia) | Rust | ![Linux][rustia-linux] ![macOS][rustia-macos] ![Windows][rustia-windows] [![iOS][rustia-ios]](https://rustia.dev/docs/api/rustia/#luau-note-1 "iOS · Tested on a physical iPad") [![Android][rustia-android]](https://rustia.dev/docs/api/rustia/#luau-note-1 "Android · Tested on an Android 15 emulator") [![Browser Wasm][rustia-browser]](https://github.com/slowchop/rustia/blob/main/demos/web-live/README.md "Browser Wasm · Demo") [\[1\]](#luau-note-1) | [Keeps chosen state](https://rustia.dev/docs/api/rustia/#keeping-state-across-script-edits) | [✓ Tested](https://github.com/slowchop/rustia/blob/main/demos/web-live/README.md#record-the-race) |
| [luaur](https://github.com/pjankiewicz/luaur) · [Playground](https://pjankiewicz.github.io/luaur/) | Rust | [![Linux][rustia-linux] ![macOS][rustia-macos] ![Windows][rustia-windows]](https://github.com/pjankiewicz/luaur/blob/f0eac7f7cce691d0cdb0b93c3eef9d599f71d739/.github/workflows/ci.yml "Linux, macOS, Windows evidence") [![Browser Wasm][rustia-browser]](https://pjankiewicz.github.io/luaur/ "Browser Wasm · Playground") [\[2\]](#luau-note-2) | [Host-managed state](https://docs.rs/luaur/0.1.8/luaur/struct.Lua.html#method.register_module) | Unverified |
| [ulua](https://github.com/webc-site/ulua) · [Playground](https://webc-site.github.io/ulua/) | Rust | [![Linux][rustia-linux] ![macOS][rustia-macos] ![Windows][rustia-windows]](https://github.com/webc-site/ulua/blob/975ebfe98327a968b0b5b2ac787795145bce0101/.github/workflows/ci.yml "Linux, macOS, Windows evidence") [![Browser Wasm][rustia-browser]](https://webc-site.github.io/ulua/ "Browser Wasm · Playground") [\[3\]](#luau-note-3) | [Host-managed state](https://docs.rs/ulua/0.1.7/ulua/struct.Lua.html#method.register_module) | Unverified |
| [ruau](https://github.com/cortesi/ruau) · [Documentation](https://docs.rs/ruau/latest/ruau/) | Rust | ![Linux][rustia-linux] [\[4\]](#luau-note-4) | [Fresh module](https://github.com/cortesi/ruau/blob/aab5052e1a3d6ed91c3e8860f950ecfea972030d/crates/ruau-vm/src/lib.rs#L1522-L1602) | [◐ Controls](https://github.com/cortesi/ruau/blob/aab5052e1a3d6ed91c3e8860f950ecfea972030d/crates/ruau-vm/src/limits.rs#L54-L77) |
| [luau-rs/luau](https://github.com/luau-rs/luau) · [Playground](https://play.luau.rs/) | Rust | [![Linux][rustia-linux]](https://github.com/luau-rs/luau/blob/99cc8ce63190b7535a65752faa84ce620b4230c0/.github/workflows/ci.yml "Linux evidence") [![Browser Wasm][rustia-browser]](https://github.com/luau-rs/luau/blob/99cc8ce63190b7535a65752faa84ce620b4230c0/.github/workflows/browser.yml "Browser Wasm · CI tests") [\[5\]](#luau-note-5) | Unverified | Unverified |
| [mlua](https://github.com/mlua-rs/mlua) · [Documentation](https://docs.rs/mlua/latest/mlua/) | Luau C++ | [![Linux][rustia-linux] ![macOS][rustia-macos] ![Windows][rustia-windows]](https://github.com/mlua-rs/mlua/blob/3c0fd858825a4756e5e858356c3c70ab83e64dbe/.github/workflows/main.yml "Linux, macOS, Windows evidence") [![Browser Wasm][rustia-browser]](https://github.com/mlua-rs/mlua/blob/3c0fd858825a4756e5e858356c3c70ab83e64dbe/.github/workflows/main.yml#L221-L259 "Browser Wasm · Build") [\[6\]](#luau-note-6) | [Host-managed state](https://docs.rs/mlua/0.12.3/mlua/struct.Lua.html#method.register_module) | Unverified |
| [Lune](https://github.com/lune-org/lune) · [Documentation](https://lune-org.github.io/docs/) | Luau C++ | [![Linux][rustia-linux] ![macOS][rustia-macos] ![Windows][rustia-windows]](https://github.com/lune-org/lune/blob/v0.11.1/.github/workflows/release.yaml "Linux, macOS, Windows evidence") [\[7\]](#luau-note-7) | Unverified | Unverified |

<details class="speed-details">
  <summary>What we checked</summary>
  <dl class="comparison-evidence">
    <dt>Runtime</dt><dd>The implementation that executes Luau. Luau C++ refers to the upstream Luau runtime.</dd>
    <dt>Platforms</dt><dd>Platform evidence comes from CI, release builds or recorded runs. The globe links to a browser demo, test or build. A build confirms compilation. Rustia’s ARM64 mobile checks ran on a physical iPad and an Android 15 emulator.</dd>
    <dt>Hot Reload</dt>
    <dd>The app keeps running in each documented reload path.
      <ul>
        <li><strong>Keeps chosen state.</strong> The embedder can carry selected script state across edits, as the Rustia garden does.</li>
        <li><strong>Fresh module.</strong> The replacement starts with new module-local variables.</li>
        <li><strong>Host-managed state.</strong> The host supplies the replacement and decides what to carry forward.</li>
        <li><strong>Unverified.</strong> The sources showed how to run edited code without establishing a reload path.</li>
      </ul>
    </dd>
    <dt>Replay</dt><dd>Rustia’s recorded deterministic race matched on native and browser Wasm. ruau documents controls for seeds and the clock. Unverified means the reviewed sources did not establish replay support or provide a matching run.</dd>
  </dl>
</details>

**Sources and details** · Checked 20 November 2026.

1. <a id="luau-note-1"></a>Rustia restores the previous script state when a module install fails. Its deterministic mode reproduces the native run in a browser. ARM64 mobile tests passed on a physical iPad and an Android 15 emulator, with a browser run in iPad Safari. [Compiler](https://github.com/slowchop/rustia/blob/main/crates/rustia-compiler/src/lib.rs) · [Hot reload](https://github.com/slowchop/rustia/blob/main/crates/rustia/examples/hot_reload.rs) · [Native/Wasm replay](https://github.com/slowchop/rustia/blob/main/demos/web-live/README.md#record-the-race) · [Desktop](https://github.com/slowchop/rustia/blob/main/design/96-browser-platform-acceptance.md) · [Mobile](https://github.com/slowchop/rustia/blob/main/design/96-browser-platform-acceptance.md#type-grammar-candidate-execution--2026-11-13) · [Safari](https://github.com/slowchop/rustia/blob/main/design/96-browser-platform-acceptance.md#physical-ipad-safari-execution--2026-11-14)
2. <a id="luau-note-2"></a>luaur 0.1.8 is a Rust port. The host can replace a registered module in the same VM. Native JIT execution is outside this version’s scope. [Project](https://github.com/pjankiewicz/luaur/tree/f0eac7f7cce691d0cdb0b93c3eef9d599f71d739) · [Code generation](https://github.com/pjankiewicz/luaur/blob/f0eac7f7cce691d0cdb0b93c3eef9d599f71d739/crates/luaur-code-gen/src/functions/compile_code_gen_context.rs) · [Desktop CI](https://github.com/pjankiewicz/luaur/blob/f0eac7f7cce691d0cdb0b93c3eef9d599f71d739/.github/workflows/ci.yml) · [Module API](https://docs.rs/luaur/0.1.8/luaur/struct.Lua.html#method.register_module)
3. <a id="luau-note-3"></a>ulua 0.1.7 forks luaur and adds an opt-in native JIT. The host can replace a registered module in the same VM. [Project](https://github.com/webc-site/ulua/blob/975ebfe98327a968b0b5b2ac787795145bce0101/README.md) · [JIT](https://github.com/webc-site/ulua/blob/975ebfe98327a968b0b5b2ac787795145bce0101/README.md#jit-native-acceleration--switching) · [Desktop CI](https://github.com/webc-site/ulua/blob/975ebfe98327a968b0b5b2ac787795145bce0101/.github/workflows/ci.yml) · [Module API](https://docs.rs/ulua/0.1.7/ulua/struct.Lua.html#method.register_module)
4. <a id="luau-note-4"></a>ruau 0.3.0 lets the host unload modules and fix the clock, hash seed and random seed. Its docs describe a Wasm clock. Cross-target replay and browser execution are unverified. [Project](https://github.com/cortesi/ruau/tree/aab5052e1a3d6ed91c3e8860f950ecfea972030d) · [Linux run](https://github.com/slowchop/rustia/blob/da1b8e546d4108d657d875b60ad28dffb354a974/bench/RESULTS.md) · [Wasm clock](https://github.com/cortesi/ruau/blob/aab5052e1a3d6ed91c3e8860f950ecfea972030d/crates/ruau-vm/src/limits.rs#L29-L77) · [Module API](https://github.com/cortesi/ruau/blob/aab5052e1a3d6ed91c3e8860f950ecfea972030d/crates/ruau-vm/src/lib.rs#L1522-L1602) · [Seed controls](https://github.com/cortesi/ruau/blob/aab5052e1a3d6ed91c3e8860f950ecfea972030d/crates/ruau-vm/src/limits.rs)
5. <a id="luau-note-5"></a>luau-rs/luau runs new chunks in the same VM and tests browser execution. Native code generation is in development. [Project](https://github.com/luau-rs/luau/blob/99cc8ce63190b7535a65752faa84ce620b4230c0/README.md) · [Embedding API](https://github.com/luau-rs/luau/blob/99cc8ce63190b7535a65752faa84ce620b4230c0/packages/luau/README.md) · [Browser CI](https://github.com/luau-rs/luau/blob/99cc8ce63190b7535a65752faa84ce620b4230c0/.github/workflows/browser.yml)
6. <a id="luau-note-6"></a>mlua binds Rust to upstream C++ Luau and also supports Lua. The host can replace a registered module. CI builds for Emscripten. Bare Wasm needs WASI imports and Wasm exceptions. [Project](https://github.com/mlua-rs/mlua/blob/3c0fd858825a4756e5e858356c3c70ab83e64dbe/README.md) · [JIT](https://luau.org/performance/) · [Emscripten](https://github.com/mlua-rs/mlua/blob/3c0fd858825a4756e5e858356c3c70ab83e64dbe/.github/workflows/main.yml#L221-L259) · [Bare Wasm](https://github.com/mlua-rs/mlua/blob/3c0fd858825a4756e5e858356c3c70ab83e64dbe/docs/wasm32.md) · [Module API](https://docs.rs/mlua/0.12.3/mlua/struct.Lua.html#method.register_module)
7. <a id="luau-note-7"></a>Lune 0.11.1 uses mlua. It can load an edited script or bundle its VM and bytecode into a standalone executable. [Project](https://github.com/lune-org/lune/tree/v0.11.1) · [Executable](https://github.com/lune-org/lune/blob/v0.11.1/crates/lune/src/standalone/mod.rs) · [Desktop releases](https://github.com/lune-org/lune/blob/v0.11.1/.github/workflows/release.yaml) · [Script loading](https://github.com/lune-org/lune/blob/v0.11.1/crates/lune-std-luau/src/lib.rs)

# Performance

See the [runtime speed charts on rustia.dev](https://rustia.dev/#speed-comparison) for five workloads, exact timings, and benchmark methodology.

<!-- Generated platform image references -->

[rustia-linux]: data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgdmlld0JveD0iMCAwIDIwIDIwIiByb2xlPSJpbWciIGFyaWEtbGFiZWxsZWRieT0ibGludXgtaWNvbi10aXRsZSI+CiAgPHRpdGxlIGlkPSJsaW51eC1pY29uLXRpdGxlIj5MaW51eDwvdGl0bGU+CiAgPHJlY3QgeD0iLjUiIHk9Ii41IiB3aWR0aD0iMTkiIGhlaWdodD0iMTkiIHJ4PSIzIiBmaWxsPSIjZjRmNWY2IiBzdHJva2U9IiM3MzdiODAiLz4KICA8cGF0aCBmaWxsPSIjMWIyMjI2IiBkPSJNMTAgMmMtMi4yIDAtMy41IDEuOC0zLjUgNC40IDAgMi43LTIuNiA0LjQtMy4xIDcuMy0uMS43LjMgMSAuOS43bDEuNC0uOWMuMSAyLjIgMS45IDMuNyA0LjMgMy43czQuMi0xLjUgNC4zLTMuN2wxLjQuOWMuNi4zIDEgMCAuOS0uNy0uNS0yLjktMy4xLTQuNi0zLjEtNy4zQzEzLjUgMy44IDEyLjIgMiAxMCAyWiIvPgogIDxlbGxpcHNlIGN4PSIxMCIgY3k9IjEyLjMiIHJ4PSIzIiByeT0i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