feat(runtime): tree-walk interpreter for Marqdo IR
Blueprint sections 7.2 and 3: Marqdo executes with its own Rust interpreter. - Frames with isolated scopes, named/positional argument binding, explicit signature rules, compile-time constant defaults evaluated in an empty frame. - Statements: assignment, expression statements, link-form calls, branch (first true arm), loop (condition re-evaluated, return propagates), return. - Expressions: exact Int arithmetic, `/` always Float, mixed arithmetic Float, exact Int/Float comparisons via rationals, Text concatenation, short-circuit and/or, Bool-only conditions, indexes with negative positions, map/Formula/ Code member access, calls (same module, imports, FunctionRef values). - Builtins: print/len/type/str/int/float/table/ref plus capability-host dispatch for math.*, foreign.*, fs.*; `ref` resolves functions or exactly one inert resource and errors on ambiguity instead of picking the first. - Fuel, stack-depth and wall-clock budgets are enforced; call errors carry a structured stack of frames. - End-to-end tests: recursion, loops, explicit positional signatures, builtins, function references, non-Bool conditions, fuel/stack exhaustion, ambiguous references.
This commit is contained in:
1 parent
d54fda9e78
commit
2e49c7b855
6 files changed
+1709
No files matched your search
@@ -14,5 +14,14 @@ marqdo-value = { workspace = true }
|
||||
marqdo-ir = { workspace = true }
|
||||
marqdo-expression = { workspace = true }
|
||||
marqdo-host = { workspace = true }
|
||||
num-bigint = { workspace = true }
|
||||
num-rational = { workspace = true }
|
||||
num-traits = { workspace = true }
|
||||
thiserror = { workspace = true }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
marqdo-frontend = { workspace = true }
|
||||
marqdo-sandbox = { workspace = true }
|
||||
tempfile = { workspace = true }
|
||||
serde_json = { workspace = true }
|
||||
Reference in new issue
Block a user