23 releases (breaking)

new 0.18.1 Aug 5, 2020
0.17.0 Jul 13, 2020
0.10.1 Mar 3, 2020
0.9.1 Jul 23, 2019
0.2.0 Mar 26, 2016

#8 in Embedded development

Download history 239/week @ 2020-04-20 366/week @ 2020-04-27 412/week @ 2020-05-04 606/week @ 2020-05-11 314/week @ 2020-05-18 360/week @ 2020-05-25 262/week @ 2020-06-01 263/week @ 2020-06-08 347/week @ 2020-06-15 308/week @ 2020-06-22 359/week @ 2020-06-29 286/week @ 2020-07-06 600/week @ 2020-07-13 449/week @ 2020-07-20 330/week @ 2020-07-27 393/week @ 2020-08-03

1,619 downloads per month
Used in 11 crates (6 directly)

MIT/Apache

695KB
14K SLoC

Rhai - Embedded Scripting for Rust

GitHub last commit Build Status license crates.io crates.io API Docs

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

Standard features

Protection against attacks

  • Sand-boxed - the scripting engine, if declared immutable, cannot mutate the containing environment unless explicitly permitted (e.g. via a RefCell).
  • 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

Documentation

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

Playground

An Online Playground is available with syntax-highlighting editor. Scripts can be evaluated directly from the editor.

License

Licensed under either:

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.

Dependencies

~0.2–1.8MB
~34K SLoC