Expand description
Tree-walking interpreter with heap-threading, prototype-walking field
access, and throw/try-catch non-local control flow.
Spike 4 adds two new evaluation cases:
Expr::Throw: evaluate the inner expression, then emitError::Throwncarrying the resulting value plus the current heap and fuel. Existing?-propagation through every other case unwinds the stack until either an enclosingExpr::TryCatchcatches the signal or it reaches the top boundary as an uncaught exception.Expr::TryCatch: evaluate the body; onError::Thrown, bind the thrown value to the catch parameter and evaluate the handler with the heap and fuel that were live at the moment of the throw. OtherErrorvariants propagate unchanged.
Substitution traverses the new variants without introducing new binders.
Structs§
- Fuel
- A step budget for evaluation.
Functions§
- eval
- Evaluate
expragainstenvwith the given heap and step budget.