Predicates

A predicate is a function that returns true or false. In general a (scalar) 'type' is a string plus some predicates that return true. Even a vector type can have a string representation, like JSON or XML. Indeed, the simplest general vector type is a list of elements, each of which can either be a scalar or a vector. This describes an n-ary tree. One important specialization is to say that each list has a name, and other attributes, in addition to it's children. A great deal of trouble has been caused by the inability of languges to naturally represent this data-structure!

    {a: 1, b: 2, c: 3}
    [a, 1, b, 2, c, 3]
    [a, b, c][1, 2, 3]

We must also support lists of these tuples, themselves named, and also nested tuples. These are related.

    [{a: 1, b: 2, c: 3}, {a: 4, b: 5, c: 6}]
    [[a, 1, b, 2, c, 3], [a, 4, b, 5, c, 6]]
    [a, b, c][1, 2, 3, 4, 5, 6]

The third form starts to look appealing for it's brevity. However it fails for locality. The data and it's description are separated. Unless of course we have another outer array, this one with only two elements, which represents a typed container. But even this suffers because individual items in that list can't be easily extracted, requiring awareness of the caller to do so properly. By contrast, the first form succeeds with locality - although it also fails to assure us that this list is in any way homogenous and well-behaved (e.g. no holes in it). The desire to make these assurances can drive us to make unwise decisions about our runtime, for example encapsulating state in some custom, clever container that enforces these invariants. No, instead we do the simple thing and ask users to politely not mutate certain data-structures, specified as a list of paths from your application or library root.

There is only one Core. It's an image that comes to life on your machine, and is modified from there. Stopping and starting are relatively minor details in it's existence; the important thing is that it exposes a good part of the world to you. The list of events since birth is maintained in a log. The current state is computed as new events come in, and the ability to do this is what's called "running". The 'current state' can be characterized as a pattern of references to input, and combinations of input.

Combining objects

Object Patterns

Snippets

major: html, minor: viewport, favicon, jquery, d3, etc