Skip to content

Derive and run

A program that is a list of steps looks like a sequence. For pure steps, it is not. It is a graph that someone wrote down in one order.

The glyphs so far: 15, 3 new on this page
  • 42Data: a value without a type
  • number
    42
    A document: the tab is its type
  • number
    42
    A dashed tab: the container declares the type
  • add
    number
    1
    number
    2
    Parts: a card inside a card
  • kindA kind: a document of type kind
  • OKDA rung: own, kind or default
  • 3A port: the result of a document
  • 0A sealed part: an evaluator cannot read it
  • #NAME?An error value, in a red port
  • numbera
    3
    A name tag: a binding for later steps
  • ref
    namesa
    A reference: a path from a root of the context
  • if
    test
    bool
    true
    true
    then
    text
    “yes”
    “yes”
    else
    text
    “no”
    not evaluated
    “yes”
    Not evaluated: a part that its parent did not need
  • ▸log
    text
    “hi”
    “hi”
    “hi”
    The run side: a magenta edge, and an effectnew
  • 1log“hi”An effect: a numbered ticket in the worldnew
  • logA capability: an effect that a term can causenew
8 of 120 orders give the same result.

As written

  1. 1a: Load the prices
  2. 2b: Load the rates
  3. 3c: Convert a with b
  4. 4d: Write a log line
  5. 5e: Save c

As a graph

a: pureb: purec: pured: effecte: effect
  • a step reads a result
  • effects keep their order
A list of pure steps is a graph that someone wrote down in one order. Each order that obeys the arrows gives the same result. A step with an effect also keeps its place among the other effects. Mark more effects, and fewer orders stay correct.

A pure step reads values and gives a value. Two orders that obey the arrows give the same result. A step with an effect is different. A log line before a save and a log line after a save are two different histories. Thus each effect keeps its place among the other effects.

coeval puts each kind on one of two sides.

Derive Run
Effects None Yes, with capabilities
Order Any order that obeys the data The written order
When When something reads the value, or when its data changes When a trigger starts it
Again after a change of data Yes No
Examples Formulas, trees of components, layout rules, queries Sequences of calls, event handlers

An event handler holds a run as data. The derive side can compute the handler, and the run starts only when its event comes. A change of data does not repeat an effect. The loop on the home page shows both sides.