rhaiscript / Rhai
Licence: other
Rhai - An embedded scripting language for Rust.
Stars: ✭ 958
Programming Languages
rust
11053 projects
Projects that are alternatives of or similar to Rhai
TypeScriptXX
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.
Stars: ✭ 33 (-96.56%)
Mutual labels: embedded, webassembly, wasm
Wasmjit
Small Embeddable WebAssembly Runtime
Stars: ✭ 1,063 (+10.96%)
Mutual labels: webassembly, wasm, embedded
Wasm3
🚀 The fastest WebAssembly interpreter, and the most universal runtime
Stars: ✭ 4,375 (+356.68%)
Mutual labels: webassembly, wasm, embedded
Wasm Micro Runtime
WebAssembly Micro Runtime (WAMR)
Stars: ✭ 2,440 (+154.7%)
Mutual labels: webassembly, wasm, embedded
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+752.71%)
Mutual labels: wasm, embedded, webassembly
Smartcircle
✂️Automatically determine where to crop a circular image out of a rectangular.
Stars: ✭ 29 (-96.97%)
Mutual labels: webassembly, wasm
Notecalc3
NoteCalc is a handy calculator trying to bring the advantages of Soulver to the web.
Stars: ✭ 879 (-8.25%)
Mutual labels: webassembly, wasm
Webassembly
A minimal toolkit and runtime to produce and run WebAssembly modules.
Stars: ✭ 786 (-17.95%)
Mutual labels: webassembly, wasm
Wasm2kt
Web Assembly to Kotlin and Java converter. Allows to compile a C or C++ program/library, and generate a Kotlin or Java program/library.
Stars: ✭ 18 (-98.12%)
Mutual labels: webassembly, wasm
Wasm Check
TypeScript / JavaScript library for detect WebAssembly features in node.js & browser
Stars: ✭ 30 (-96.87%)
Mutual labels: webassembly, wasm
Markdown Wasm
Markdown parser and HTML generator implemented in WebAssembly, based on md4c
Stars: ✭ 833 (-13.05%)
Mutual labels: webassembly, wasm
Wagon
wagon, a WebAssembly-based Go interpreter, for Go.
Stars: ✭ 882 (-7.93%)
Mutual labels: webassembly, wasm
Bionic
** Bionic - An Ionic CLI clone for Blazor projects ** moved to:
Stars: ✭ 28 (-97.08%)
Mutual labels: webassembly, wasm
Zemeroth
😠⚔️😈 A minimalistic 2D turn-based tactical game in Rust
Stars: ✭ 940 (-1.88%)
Mutual labels: webassembly, wasm
Wasm Json Toolkit
[ORPHANED] A small toolkit for converting wasm binaries into json and back.
Stars: ✭ 23 (-97.6%)
Mutual labels: webassembly, wasm
Terrarium Templates
Template and example projects for Fastly Labs Terrarium https://wasm.fastlylabs.com
Stars: ✭ 21 (-97.81%)
Mutual labels: webassembly, wasm
Rhai - Embedded Scripting for Rust
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
- Simple language similar to JavaScript+Rust with dynamic typing.
- Fairly efficient evaluation (1 million iterations in 0.3 sec on a single-core, 2.3 GHz Linux VM).
- Tight integration with native Rust functions and types, including getters/setters, methods and indexers.
- Freely pass Rust variables/constants into a script via an external
Scope
- all clonable Rust types are supported; no need to implement any special trait. - Built-in support for most common data types including booleans, integers, floating-point numbers (including
Decimal
), strings, Unicode characters, arrays and maps. - Easily call a script-defined function from Rust.
- Relatively little
unsafe
code (yes there are some for performance reasons). - Few dependencies (currently only
smallvec
,num-traits
andahash
). - Re-entrant scripting engine can be made
Send + Sync
(via thesync
feature). - Compile once to AST form for repeated evaluations.
- Scripts are optimized (useful for template-based machine-generated scripts).
- Easy custom API development via plugins system powered by procedural macros.
- Function overloading and operator overloading.
- Dynamic dispatch via function pointers with additional support for currying.
- Closures (anonymous functions) that can capture shared values.
- Some syntactic support for object-oriented programming (OOP).
- Organize code base with dynamically-loadable modules, optionally overriding the resolution process
- Serialization/deserialization support via serde (requires the
serde
feature). - Support for minimal builds by excluding unneeded language features.
Protected against attacks
- 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
- Use as a DSL.
- Restrict the language by surgically disabling keywords and operators.
- Define custom operators.
- Extend the language with custom syntax.
Project Site
Documentation
See The Rhai Book for details on the Rhai scripting engine and language.
Playground
An Online Playground is available with syntax-highlighting editor, powered by WebAssembly.
Scripts can be evaluated directly from the editor.
License
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.
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].