Are you an LLM? You can read better optimized documentation at /adrs/0001-use-luau-as-the-embedded-language.md for this page in Markdown format
0001. Use Luau as the embedded scripting language
Date: 2026-05-03
Status
Accepted
Context
Need: embedded scripting language with tight host control, fine-grained sandboxing, no JIT requirement.
Candidates:
- Lua 5.4 — small, widely embedded. Unsafe
os/io/package/debugsurface needs stripping. - Luau — Roblox's Lua dialect. Sandbox-aware by design, gradual typing, deterministic. Bindable from Rust via
mlualuaufeature. - JavaScript (Deno/Boa) — heavyweight, less amenable to fixed-resource embedding.
- WebAssembly — capable but high tooling burden on script authors.
- Custom DSL — too narrow for general-purpose scripts.
Host is Rust. Bindings story via mlua is load-bearing.
Decision
neoc uses Luau, bundled via mlua's vendored feature.
Consequences
- Luau's gradual type system and sandbox-aware design reduce host-level stripping work.
- Deterministic execution (no JIT) — predictable allocation behaviour.
- Script authors use Luau syntax. Most Lua 5.1/5.4 libraries compatible with adaptation.
- Gated on
mluaupstream's continued Luau support. vendoredbundles Luau into binary — no system Lua dependency, larger binary.