Rhai is a lightweight, embedded scripting language and evaluation engine designed specifically for integration into Rust applications, offering a safe and flexible way to add dynamic behavior without sacrificing performance or security. It features a syntax that blends familiarity from JavaScript and Rust, making it approachable for developers while maintaining expressive power through dynamic typing and simple constructs. Rhai is optimized for embedding, allowing developers to expose native Rust functions, types, and data structures directly to scripts, enabling seamless interoperability between compiled and interpreted code. The engine is designed with minimal reliance on unsafe code, prioritizing safety while still delivering efficient execution performance suitable for real-time applications. It supports a wide range of data types, including arrays, maps, and Unicode strings, as well as custom types defined in Rust, making it versatile for scripting complex logic.
Features
- Embeddable scripting engine tightly integrated with Rust applications
- Simple and expressive syntax inspired by JavaScript and Rust
- Supports dynamic typing with built-in complex data structures
- Direct interoperability with Rust functions, types, and variables
- Runs on multiple targets including WebAssembly and no_std environments
- Safe execution model with minimal use of unsafe code