luau-rs is a Rust implementation of Luau, including the
parser, bytecode compiler, bytecode model, virtual machine, standard libraries,
configuration loading, and command-line tools.
Caution
luau-rs is highly experimental. It is not ready for production use,
compatibility is incomplete, and public APIs may change without notice. For
production use, choose the official Luau implementation
or, for Rust applications, mlua with its luau feature.
The initial release covers the parser, bytecode compiler, VM, standard libraries, command-line tools, and synchronous embedding API. Native code generation, type analysis, and async embedding remain in development.
Unlike a binding that puts a Rust API around the C++ runtime, luau-rs ports
the implementation itself. Ownership, rooting, allocation, and unsafe
boundaries are therefore visible in one Rust codebase, where they can be tested,
fuzzed, and progressively tightened instead of ending at an FFI boundary.
Luau remains the source of truth for language and runtime behavior. The goal is not a new dialect or an independently evolving VM, but a source-faithful port with a safe embedding layer built on the same internal invariants.
All code in this repository was written by AI with human direction and review throughout. The project is developed through a deep, iterative human–AI loop in which scope, design constraints, source evidence, verification, and every accepted change are reviewed by a human.
Rust 1.88 or newer is required.
Install the command-line tools from crates.io:
cargo install luau-cliRun a Luau script:
luau script.luauCompile source to bytecode:
luau-compile --binary script.luau > script.luaucAdd the crate to a Rust project:
[dependencies]
luau = "0.732"Compile and execute source through the safe embedding API:
let lua = luau::Lua::new().expect("failed to create Luau state");
let answer: i32 = lua
.load("return 40 + 2")
.set_name("example")
.call(())
.expect("script failed");
assert_eq!(answer, 42);See the API documentation and runnable examples for the rest of the embedding API. Lower-level parser, compiler, bytecode, and VM crates are available separately for applications that need those boundaries directly.
See CONTRIBUTING.md before opening an issue or pull request. Report vulnerabilities as described in SECURITY.md.
luau-rs is licensed under the
MIT License. The
Unicode-derived confusables data in luau-syntax is also distributed under the
Unicode data-file license.