The architecture
The layers
Section titled “The layers”Each package imports only from the layers under it. The dependencies of the package files enforce the order.
The flow of data
Section titled “The flow of data”hydratemakes an instance tree from a value. Each instance has a root container whose slots are its cells.- The store evaluates all new nodes in one epoch.
splayrenders the tree with the render methods of the classes, through a memo.- An edit writes a cell (
setValue). The store starts one ordered epoch over the readers of the cell. - The host deletes the memo entries of the changed instances and renders again.
- For a user class, the edit also changes the class, and
updateClasssends it to the other instances.
The invariants
Section titled “The invariants”| Invariant | Who keeps it |
|---|---|
| The value of each node is the evaluation of its expression | Each write starts an epoch, or a batch starts one at its end |
| The seats agree with the reads | The flush rewires each touched node |
| The expression of a container is the record of its slots | setSlot, expandNode and the removal make the record again |
| Each slot points at a node of the store | removeNode detaches each slot of each holder |
| A node outside a cycle evaluates at most one time in an epoch | The topological order of the components of the closure |
| A write is not reverted | A write changes the expression, and the value comes from the expression |
The decisions
Section titled “The decisions”The decisions record each choice and its reason. The review records each defect that the October review found, with the live status of its regression test.