#scripting #scripting-language #embedded #scripting-engine

no-std bin+lib rhai

Embedded scripting for Rust

46 releases (4 stable)

1.0.4 Sep 3, 2021
1.0.2 Aug 17, 2021
1.0.0 Jul 7, 2021
0.20.3 Jun 22, 2021
0.2.0 Mar 26, 2016

#4 in Embedded development

Download history 1308/week @ 2021-05-29 1667/week @ 2021-06-05 1524/week @ 2021-06-12 1779/week @ 2021-06-19 1691/week @ 2021-06-26 1314/week @ 2021-07-03 1299/week @ 2021-07-10 1433/week @ 2021-07-17 1720/week @ 2021-07-24 1191/week @ 2021-07-31 1593/week @ 2021-08-07 2078/week @ 2021-08-14 1622/week @ 2021-08-21 1547/week @ 2021-08-28 1765/week @ 2021-09-04 2419/week @ 2021-09-11

6,722 downloads per month
Used in 23 crates (14 directly)


24K SLoC

Rhai - Embedded Scripting for Rust

GitHub last commit Build Status Stars License crates.io crates.io API Docs VS Code plugin installs Sublime Text package downloads Discord Chat Zulip Chat Reddit Channel

Rhai logo

Rhai is an embedded scripting language and evaluation engine for Rust that gives a safe and easy way to add scripting to any application.

Supported targets and builds

  • All common CPU targets for Windows, Linux and MacOS.
  • WebAssembly (WASM)
  • no-std
  • Minimum Rust version 1.49

Standard features

Protected against attacks

  • Don't Panic guarantee - Any panic is a bug. Rhai subscribes to the motto that a library should never panic the host system, and is coded with this in mind.
  • Sand-boxed - the scripting engine, if declared immutable, cannot mutate the containing environment unless explicitly permitted.
  • Rugged - protected against malicious attacks (such as stack-overflow, over-sized data, and runaway scripts etc.) that may come from untrusted third-party user-land scripts.
  • Track script evaluation progress and manually terminate a script run.

For those who actually want their own language

Project Site



See The Rhai Book for details on the Rhai scripting engine and language.


An Online Playground is available with syntax-highlighting editor, powered by WebAssembly.

Scripts can be evaluated directly from the editor.


Licensed under either of the following, at your choice:

Unless explicitly stated otherwise, any contribution intentionally submitted for inclusion in this crate, as defined in the Apache-2.0 license, shall be dual-licensed as above, without any additional terms or conditions.


~65K SLoC