Skip to content

The architecture

Each package imports only from the layers under it. The dependencies of the package files enforce the order.

The layers of render, from the optional type at the bottom to the viewer at the topviewersplaybiblonodedsloptionalpackseatcoeval kernelReact viewrender engineclassesreactive storeexpressionstotal values
The core layers and, with a dashed line, the packages outside the core. The packages pack and seat are standalone, and the viewer uses pack for its layout. The package dsl evaluates through the coeval kernel.

An expression is a coeval document. The kernel of coeval holds the machinery (decision D13 of coeval, and AD-46). It compiles a document into a plan, evaluates the plan, finds the references and checks a document. The project render gives only its own parts: the profile of its formula language, its ops, its store of nodes and its epochs.

  1. hydrate makes an instance tree from a value. Each instance has a root container whose slots are its cells.
  2. The store evaluates all new nodes in one epoch.
  3. splay renders the tree with the render methods of the classes, through a memo.
  4. An edit writes a cell (setValue). The store starts one ordered epoch over the readers of the cell.
  5. The host deletes the memo entries of the changed instances and renders again.
  6. For a user class, the edit also changes the class, and updateClass sends it to the other instances.
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 record each choice and its reason. The review records each defect that the October review found, with the live status of its regression test.