Purple Session Bindings
The boot installs fourteen bindings into the session environment before the prelude loads — the Pink machinery of Part III, made available at the prompt. They fall into four groups.
Sources
Programs as data, exactly as read or spliced at boot:
pink-poly-src— the contents oflib/pink-forms.naj: the stage-polymorphic evaluator as one expression.pink-tie-src—pink-poly-srcwrapped with the knot-tying lambda; takes anlpair.pink-eval-src—pink-tie-srcapplied to the identity lift, as source.pink-evalc-src—pink-tie-srcapplied to the real lift, as source.
(car pink-poly-src)
;=> 'let
Evaluators
The same four, animated:
pink-poly— the evaluator awaiting its own recursion (tie).pink-tie— the knot tied; takes anlpair, gives an evaluator.pink-eval—((pink-eval src) env)interpretssrc.pink-evalc— the compiling reading; applications of it must be enclosed by therunthat scopes their generated code (the Futamura chapter’s discipline).
((pink-eval '(car '(a b))) nil-env)
;=> 'a
Futamura artifacts
Compiled at every boot:
compiler—pink-evalcompiled bypink-evalc(the second projection): an evaluator with the interpretive overhead removed, used exactly likepink-eval.evalc-compiled—pink-evalccompiled by itself (the third projection): the compiler as a compiled artifact.
((compiler '(+ 1 2)) nil-env)
;=> 3
Helpers
nil-env— the empty Pink environment,(lambda _ y 0): every lookup answers 0.((interpret src) env)—pink-eval, spelled as a verb.(compile src)—(run 0 ((evalc-compiled src) nil-env)): compile a closed program and execute the residual, all inside onerunscope.(run-compiled anf)—(run 0 anf)for code compiled within the same scope; code generated loose at the prompt dangles, per the Futamura chapter.
((interpret '(+ 1 2)) nil-env)
;=> 3
(compile '(* 6 7))
;=> 42
The prelude’s five functions (previous chapter) arrive on top of
these, and load/define are loop forms, not bindings. Two more
names exist in lib/purple.naj but are boot-internal, not installed:
load-into, a Pink-path loader that folds a file’s define forms
into an environment-as-function, and tower-load, the loader behind
the loop’s load.