Expand description
Ion — an embeddable scripting language for Rust.
Ion is a small, strongly-typed scripting language inspired by Starlark, designed for embedding in Rust applications. It features a tree-walk interpreter and an optional bytecode VM for better performance.
§Quick Start
use ion_core::engine::Engine;
let mut engine = Engine::new();
let result = engine.eval("1 + 2").unwrap();
assert_eq!(result, ion_core::value::Value::Int(3));§Features
vm(default) — Bytecode compiler and stack-based VM with peephole optimization, constant folding, dead-code elimination, and tail-call optimizationderive(default) —#[derive(IonType)]for host type injectionasync-runtime— Native Tokio async evaluation via [engine::Engine::eval_async], async host functions,spawn/.await/select, timers, and channelslegacy-threaded-concurrency— Legacy sync-eval backend using OS threads and crossbeam channelsmsgpack—Value::to_msgpack()/from_msgpack()viarmpvobfuscate— String obfuscation viaobfstrrewrite— Source rewriter at [rewrite::replace_global]
Re-exports§
Modules§
- ast
- bytecode
- Bytecode instruction set and chunk representation for the Ion VM.
- compiler
- AST → Bytecode compiler for the Ion VM.
- engine
- env
- error
- host_
types - intern
- String interner for fast variable name lookups.
- interpreter
- lexer
- module
- parser
- stdlib
- Built-in standard library modules.
- token
- value
- vm
- Stack-based virtual machine for executing Ion bytecode.