Language
Under the surface.
The keyword pages and targets describe what you write. This section describes what happens to it: how source is read, how a module is stored, how its state lives while it runs, and the loop that drives a program forward. None of it is something you have to think about to write Program — it is here for when you want to know how the machine underneath works.
The path a program takes
A Program starts as text and ends as a running process. A handful of stages sit between:
- Grammar — the rules each line of source is written against.
- Parsing walks the lines as an indentation tree in one pass, building the tree and checking as it goes.
- Tree is the direct, line-for-line shape the program first becomes: one node per line, nesting as branches.
- Structure is the canonical JSON command form the tree is written to — the single artefact everything else reads.
- State is what the canonical form's state cells become once the compiler renders them into a running target: the values that actually change.
- Running is the loop that feeds state and updates in, and takes effects and new state out.
The six pages
Grammar →
The whole grammar in one place: keyword rules and the shared inner rules they draw on.
Parsing →
Walking the lines as an indentation tree in one pass, carrying state to check and infer as it goes.
Tree →
Code.Language.Program.Tree: the direct line-for-line tree, one node per line plus its branches.
Structure →
The canonical JSON shape every keyword serialises to, the form modules are stored in.
State →
Canonical CVJSON as the source of truth, rendered into reactive cells that carry state between cycles.
Running →
The update cycle: state and updates in; effects and new state out; drivers close the loop.