Skip to content

Commit d3b33e3

Browse files
committed
Update comment and ARCHITECTURE.md
1 parent 99b25fd commit d3b33e3

2 files changed

Lines changed: 14 additions & 6 deletions

File tree

ARCHITECTURE.md

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
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
```
@@ -53,8 +53,12 @@
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
@@ -67,10 +71,13 @@
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 |

src/runtime/evaluate.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
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.
67
import {
78
argumentExpr,
89
argumentListArguments,

0 commit comments

Comments
 (0)