Module eval

Module eval 

Source
Expand description

The evaluator: staging state (EvalCtx), the lift operator, and the entry points evalms / evalmsg.

Evaluation proper is the CK machine in machine; the trans translation from source-as-data to expressions is in staging. This module holds what the machine threads through every step — the state base.scm keeps in global mutable variables (fresh, the open statement block, the stFun memoization registry, the run level) plus narju’s additions: the cell heap and the I/O handle.

The staging model follows the paper’s normalization-by-evaluation reading: evaluating under lift produces values of kind code, and every reflected statement lands in the innermost open block, which reifyv/reifyc drain into ANF Let-chains when their scope closes.

Modules§

machine
CK machine — explicit-continuation iterative evaluator.
staging
Pink bridge layer: Exp ↔ Val cons-list conversion and the trans pass.

Structs§

EvalCtx
Staging and effect state threaded through evaluation.

Functions§

display
Render a value the way the REPL prints results. Identical to the fmt::Display impl on Val; kept as a named function because call sites that format for catch payloads and prompts read better with one.
evalms
Public evaluator entry point — drives the CK machine.
evalmsg
Paper: evalmsg(env, e) = reifyv(lambda () evalms(env, e)).