Skip to content

The model in one page

coeval has six rules. A language that obeys them gets the shared parts. These parts are one form of document, one ladder, one context, one form of result and one check before a start.

  1. A program is a document. It is a value in an envelope: { type, value }. The type names a kind. A store keeps the document, and an editor changes it like any other data.
  2. A question finds the meaning. To evaluate a document, coeval asks it a verb, for example view. The answer comes from the own entry of the document, then from its kind, then from the default. Refer to the ladder.
  3. An evaluator evaluates its parts, and does not look inside them. It gets each part as a document. It can evaluate the part, in a context that it chooses, or give the part to another evaluator. Refer to evaluators.
  4. A context is the only door. A term reaches outside itself through five parts: names, focus, world, event and capabilities. Refer to context.
  5. Order has a meaning only for effects. Pure work can run in any order that obeys its data. Effects keep their written order. Refer to derive and run.
  6. A reference is a path from a root of the context. Each step is a question to the thing that the path reached. A type is a path into the world. Refer to paths.
One for all languages Many, one for each language
The envelope: type, value, name and own The kinds and their evaluators
The ladder The verbs that a kind answers
The grammar of a path The structures that a path goes through
The parts of a context Which parts a construct reads, and what it gives its body
The result: a value, or an error value with a reason The values of each domain
The contract of a kind: its fields, its types, its context and its effects The checks that a kind adds

The model has two sides. Each kind is on one side.

  • Derive is pure. Formulas, trees of components, layout rules and queries are on this side. A host can compute them in any order, keep their results, and compute them again when the data changes.
  • Run causes effects. Sequences of calls and event handlers are on this side. A run starts on a trigger, and its steps go in the written order. A change of data does not start a run again.