Skip to main content

Module eval

Module eval 

Source
Expand description

Tree-walking interpreter with heap-threading.

Every reduction step takes a Heap and a Fuel budget by value and returns a (possibly new) Heap and Fuel alongside the resulting Value. Mutation of a reference cell is expressed by returning a heap that differs from the receiver only at the affected address. No mut, no Rc/Arc, no RefCell/Cell/Mutex, no unsafe.

Fixed points are unfolded by substitution, identical to spike 1 except that subst now traverses the four new stateful forms (Ref, Deref, Assign, Seq).

Structs§

Fuel
A step budget for evaluation.

Functions§

eval
Evaluate expr against env with the given heap and step budget.