File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3131 trees into Mozzarella values, and ` absorb.ts ` , which transforms
3232 Mozzarella values into the implementation's syntax trees
3333 * It also depends, inevitably, on the runtime. In fact, the runtime has a
34- dedicated entry function for macro calls. The order is reify, run the
34+ dedicated entry point for macro calls. The order is reify, run the
3535 macro, abstract.
3636
3737```
5353 * ` compare.ts ` handles comparison of values, as used by comparison ops
5454 * ` display.ts ` converts a value to a string for a REPL
5555 * ` env.ts ` declares environments (name/value bindings for variables)
56+ * ` frame.ts ` contains the definition of ` Frame ` and various helpers
57+ * ` infix.ts ` contains handlers for the individual infix operators
58+ * ` prefix.ts ` contains handlers for the individual prefix operators
5659 * ` stringify.ts ` can convert any value to a Mozzarella string value
57- * The runtime is a CEKJ machine, with the following parts:
60+ * The runtime is a CEKJ machine (albeit nowadays factored into the ` Frame `
61+ data type), with the following parts:
5862 * ** Code** , the next bit of the program to evaluate
5963 * ** Environment** , the current set of name/value bindings
6064 * ** Kontinuation** with a "k", a linked list of what to do next; these
6771
6872```
6973 stringify
70- location
74+ prefix
75+ infix
76+ frame
7177 env
7278 display
7379 compare
80+ cell
7481 boolify
7582 +-----------+
7683 | evaluate |
Original file line number Diff line number Diff line change 11// The evaluator
22//
3- // Can be described as a CEKJ machine. The CEK part is standard: code,
4- // environment, kontinuation with a "k". The J part contains a table of _jump
5- // targets_, making `next`/`last`/`return` work.
3+ // Structured as a CEK machine, but with the components unified into a data
4+ // type called `Frame`, which holds the "C" component (`.node`), the "E"
5+ // component (`.env`), and the "K" component (`.tail`). An additional
6+ // component, `.jumpMap`, handles nonlocal transfers of control.
67import {
78 argumentExpr ,
89 argumentListArguments ,
You can’t perform that action at this time.
0 commit comments