finds.dev← search

// the find

rhaiscript/rhai

★ 5,431 · Rust · Apache-2.0 · updated May 2026

Rhai - An embedded scripting language for Rust.

Rhai is an embedded scripting engine for Rust applications, letting you run sandboxed user-provided scripts alongside your native code. It's for Rust developers who need end-user extensibility — config scripting, game modding, rule engines — without the overhead or safety risks of embedding Lua or V8.

The sandboxing story is genuinely solid: configurable limits on call stack depth, string size, loop iterations, and total operations, plus a 'don't panic' guarantee that any panic is treated as a bug. The Rust integration is first-class — you can expose native functions and types with minimal boilerplate via the `#[export_module]` proc-macro, and any clonable type just works as a script variable without implementing special traits. The compile-to-AST + optimizer pipeline means repeated evaluation of the same script is cheap, which matters for hot paths like per-frame game logic or frequent rule evaluation. It works on `no_std` and WASM, which genuinely expands the host environments where you can ship it.

Dynamic typing is the main footgun — there's no static analysis of script correctness at load time, so type errors surface at runtime in production. The `.d.rhai` definition files for IDE support exist but are opt-in and manually maintained, meaning editor tooling is second-class unless you do extra work. Performance is reasonable for scripting (1M iterations in 0.14s) but it's an interpreter with no JIT, so compute-heavy scripts will hit a ceiling well before native code; if you're scripting tight numeric loops, that matters. The OOP support is documented as 'some syntactic support' — it's pattern-based, not a real class system, and complex object hierarchies in script code get awkward fast.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →