The model in one page
coeval has seven 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, one check before a start and one merge.
The seven rules
Section titled “The seven rules”- 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. - 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. - 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.
- A context is the only door. A term reaches outside itself through five parts: names, focus, world, event and capabilities. Refer to context.
- 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.
- 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.
- A language evaluates through the kernel. The kernel compiles a document one time into a plan, checks it before a run, and evaluates the shared constructs. A language gives its operations and its own rules, and languages compose through one merge. Refer to composition.
What is one, and what is many
Section titled “What is one, and what is many”| 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 merge of worlds and machines, with its conflict rules | The parts that a host merges into one language |
Two sides
Section titled “Two sides”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.