Reference
The specification of Synod, one page per chapter. It is normative: when an example and the specification disagree, the example is a bug. The reasons behind it are in the design decisions.
- 0. Introduction — Synod describes nodes that keep state, exchange messages over a simulated network, react to events, and are checked against invariants. A separate, purely visual layer turns what happened into an…
- 1. Lexical structure — # followed by a space, or # at the end of a line, starts a comment that runs to the end of the line. A comment may stand on its own line or follow a statement after one space. Everything after the…
- 2. Grammar — Synod is parsed in two stages:
- 3. Phrases — A phrase is a sentence pattern of words and typed holes, defined once and then used like a built-in. Everything except the language words and forms is a phrase, including the whole standard library.
- 4. Types and values — A record type name is a valid hole type, and msg accepts any record. Types nest: [ns: list of node], [m: map of node to number], list of list of node. Bare list and map are not types.
- 5. Nodes, state and contexts — Node code names its node with a receiver: a hole of a node type before the head of a definition, or after when.
- 6. Packages, modules and programs — Synod follows Go.
- 7. Execution model — A handler's after uses the clock of the context it runs in. The simulated clock has microsecond resolution.
- 8. Trace events — The trace is the ordered list of facts a run produced. Only language words and native phrases record trace events, so the core vocabulary is fixed and every look package can animate every behaviour…
- 9. The visual layer — Shapes, motion and effects are phrases built on a few natives in std/look, exactly like behaviour. Looks live in ordinary packages and run in look context (spec/05): they observe the trace, draw, and…
- 10. Canonical form — The compiler rejects non-canonical code with non-canonical errors. synod fmt rewrites any parseable file into canonical form, so in practice nobody formats by hand. Code across all repositories looks…
- 11. Errors — A diagnostic has a stable code, a location and one sentence, plus an optional hint. It is written in two forms.