luau-syntax 0.732.0

Luau lexer, parser, AST, CST, and source utilities
Documentation
# luau-rs

`luau-rs` is a Rust implementation of [Luau](https://luau.org/), 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]https://github.com/luau-lang/luau
> or, for Rust applications, [mlua with its `luau` feature]https://github.com/mlua-rs/mlua#feature-flags.

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.

## Why This Exists

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.

## Development Disclosure

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.

## Install

Rust 1.88 or newer is required.

Install the command-line tools from crates.io:

```sh
cargo install luau-cli
```

## Command-Line Usage

Run a Luau script:

```sh
luau script.luau
```

Compile source to bytecode:

```sh
luau-compile --binary script.luau > script.luauc
```

## Library Usage

Add the crate to a Rust project:

```toml
[dependencies]
luau = "0.732"
```

Compile and execute source through the safe embedding API:

```rust
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](https://docs.rs/luau) and
[runnable examples](https://github.com/luau-rs/luau/tree/main/crates/luau/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.

## Contributing

See [CONTRIBUTING.md](https://github.com/luau-rs/luau/blob/main/CONTRIBUTING.md)
before opening an issue or pull request. Report vulnerabilities as described in
[SECURITY.md](https://github.com/luau-rs/luau/blob/main/SECURITY.md).

## License

`luau-rs` is licensed under the
[MIT License](https://github.com/luau-rs/luau/blob/main/LICENSE). The
Unicode-derived confusables data in `luau-syntax` is also distributed under the
[Unicode data-file license](https://github.com/luau-rs/luau/blob/main/crates/luau-syntax/LICENSE-UNICODE).