feat: init Rust VM

This commit is contained in:
2026-03-14 11:42:39 +08:00
parent 40d00a6c47
commit 198d847151
26 changed files with 3621 additions and 994 deletions

View File

@@ -1,18 +1,18 @@
#![allow(dead_code)]
use fix::context::Context;
use fix::error::{Result, Source};
use fix::runtime::Runtime;
use fix::value::Value;
pub fn eval(expr: &str) -> Value {
Context::new()
Runtime::new()
.unwrap()
.eval(Source::new_eval(expr.into()).unwrap())
.unwrap()
}
pub fn eval_result(expr: &str) -> Result<Value> {
Context::new()
Runtime::new()
.unwrap()
.eval(Source::new_eval(expr.into()).unwrap())
}