Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Optional spec layer

When you need structured events, rules, or tests, start a file with spec instead of say lines. Stage 1 uses the same brace-free style as scripts:

KeywordRole
specName and version
state / configFields with name type is default
entityentity Name keyed by id and indented fields
eventevent E with arg type
outputDeclared outputs with indented parameters
onHandlers: on E with args if condition
rulewhen / otherwise and set / emit / reject
machinefrom to to transitions
invariant / limit / testOptional properties and tests

Tests interleave send and expect lines in order:

test adds_one
  send Tick
  expect count is 1
  send Tick
  expect count is 2

You do not need this layer for simple tools — use say scripts and romit run when that is enough.