Skip to main content

Module vm

Module vm 

Source
Expand description

M5: bytecode VM. Stack machine with effect dispatch through a host handler.

Structs§

DenyAllEffects
A handler that fails any effect call. Useful as a default for pure-only runs.
NullTracer
No-op tracer for normal execution.
Vm

Enums§

VmError

Constants§

MAX_CALL_DEPTH
Maximum simultaneous call frames. Defends against unbounded recursion in agent-emitted code: a body that calls itself without a base case would otherwise blow the host’s native stack and crash the process. Real Lex code rarely exceeds ~30 frames; 1024 is generous headroom while still well under the OS stack limit at any per-frame size we use.

Traits§

EffectHandler
Host-side effect dispatch. Implementors decide what kind/op mean and how arguments map to side effects.
Tracer
Trace receiver. Implementors record the call/effect tree and may substitute effect responses (for replay).