Rat贸n 馃悂
A tiny, highly modular, embeddable, dynamically typed scripting language with a bytecode VM, intended for use in games.
Example
[]
= {
version = "0",
= ["i32_type", "while_loop", "single_line_comment"],
= false
}
// Add up all integers from 1 to n
Status
Unfinished, do not use in production.
Components
- Parser
- Bytecode generator
- Bytecode VM
- Optimizer
- Modular standard library
Modular type system
-
null -
bool(optionalbool_typefeature) -
i32(optionali32_typefeature) -
f32(optionalf32_typefeature) -
string(optionalstring_typefeature) - Host value (optional)
- Host reference (optional)
Modular language features
-
if,else(optionalif_expressionfeature) -
while,break,continue(optionalwhile_loopfeature) -
//comments (optionalsingle_line_commentfeature) -
/* */comments (optionalmulti_line_commentfeature)
Serialization
-
serde(ast and bytecode) -
bitcode(bytecode only)
Other features
- Portable to any platform, 32 bits or higher, supported by Rust
- Parsing, code generation, and runtime have configurable limits
-
no_std - Proper error handling
- Proper error messages
Performance
Rat贸n takes ~0.3s on Fibonacci and ~0.04s on 1M Loop (see Rhai benchmarks).
Security
Rat贸n is designed to handle untrusted or malicious source code, asts, or bytecode without panicking, exhausting memory, memory unsafety, exponential time complexity, or infinite loop. Unsafe code is forbidden, and each component has a fuzzer that tests it against arbitrary inputs.
You are responsible for using the limits, such as on instructions and call stack depth, that it provides.
License
Licensed under either of
- Apache License, Version 2.0 (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)
at your option.
Contribution
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.