Learn Synod

A bottom-up tutorial: it starts with the smallest program that shows something and grows one idea at a time. Each chapter has a goal the current program cannot reach yet, introduces exactly the syntax that closes the gap, and starts from the code the previous chapter ended with. The format of a chapter is in implementation/11-documentation.md; coverage.md says which chapter teaches which form, type, context and std package.

You need the synod command (install). Every step is a complete program: type it, run it with synod run, watch, then change it.

Part I: One program, no nodes

  1. Hello: show a sentence on the stage
  2. Values: show a computed sentence
  3. Time: show sentences at different moments, and ask the viewer

Part II: Nodes and messages

  1. First node: put a node on the stage that counts
  2. Messages: two nodes play ping-pong
  3. Decisions: stop after ten rounds
  4. Phrases: remove the repeated lines
  5. Many nodes: broadcast to every peer and count replies
  6. Chance: spread a rumour to random peers

Part III: When things go wrong

  1. Faults: keep the rumour spreading through crashes and loss
  2. Invariants: say what must never happen, then break it

Part IV: Seeing it

  1. Looks: draw the system your way
  2. Story: make the important moment stand out

Part V: Building real systems

  1. Packages: build a service on top of the rumour package
  2. Raft: build examples/raft from an empty folder

Guides

After chapter 15, go on with the examples and the specification.