Expand description
VibeLang Rhai - Scripting layer for VibeLang.
This crate provides the Rhai scripting API for VibeLang, allowing users to write
.vibe scripts that define musical compositions.
§Architecture
The scripting layer works by:
- Executing a Rhai script that calls builder APIs (voice(), pattern(), etc.)
- These builders collect their configuration into a thread-local ScriptState
- After execution, the ScriptState is applied to the Runtime via the reload system
§Example
ⓘ
use vibelang_rhai::ScriptEngine;
use vibelang_core::Runtime;
let backend = /* create backend */;
let runtime = Runtime::new(backend).await?;
let mut engine = ScriptEngine::new(runtime.handle());
engine.execute_file("song.vibe").await?;Re-exports§
pub use engine::ScriptEngine;pub use error::Error;pub use error::Result;pub use api::assert::get_exit_code;pub use api::assert::reset_exit_code;