REFERENCE

Grammar

How a declaration is shaped, where vibe blocks attach, and how scope opens and closes.

An Anglish program is a list of declarations. Each declaration defines a space, path, agent, task, or data resource. Declarations are not imperative code blocks — they are structured intent statements describing how a problem decomposes and how its pieces connect.

The shape of a declaration

Each declaration has three components: a header line, optional vibe blocks, and optional subordinate declarations.

ComponentFormat
Header line<meta-char>name[:TYPE]([params])
Vibe blockOne or more contiguous lines starting with >>>
Continuation lineA line containing only >
TerminatorA blank line — closes the declaration and any nested ones

A complete declaration in canonical form:

@checkout:UI
>>> A web-based checkout form with fields for shipping, billing, and payment.
>>> The form inputs are bound to %checkoutForm.
>
$validateForm(in=%checkoutForm)
>>> Validates required fields and emits %validationErrors.
>

Headers

A header line is a single line that opens a declaration. It always begins with one of the five meta-characters, followed by a name, an optional type tag, and optional parameters.

  • @name:TYPE — space. TYPE is required.
  • #name:TYPE — agent. TYPE is DF or AF.
  • $name(params) — task. Parameters optional.
  • %name — data resource. The data line in a vibe block is enough to introduce one.
  • =name[:TYPE](@sA, @sB) — path. TYPE and an optional vibe line are accepted.

Names are case-sensitive. Identifier characters: letters, digits, underscores, and . for dotted hierarchy.

Vibe blocks

A vibe line begins with >>> followed by a single space and then natural-language prose. One or more contiguous vibe lines form a vibe block. Vibe blocks attach to the preceding header (or to the last open declaration when nested).

Vibe prose can — and frequently does — reference Anglish identifiers inline. The >>> prefix means even prose that starts with @ or % cannot be misread as a new declaration.

>>> When %checkoutForm is submitted, use $validateForm.

Continuation and termination

A line containing only > is a continuation line. It keeps the current declaration open so that additional vibe blocks or subordinate declarations can attach to it.

A blank line terminates the current declaration and every declaration nested within it. This is the only way to close a declaration.

@parent:UI
>>> Parent space.
>
$nestedTask(in=%foo)
>>> A task scoped to the parent.
>
                                          ← blank line: parent and nested both close
@another:UI
>>> A new top-level declaration.

Composition with $use()

$use() imports an independently declared space or agent into a parent. It promotes reusability and late binding without enforcing structural nesting:

  • $use(@SpaceName) — composes a named space.
  • $use(\#AgentName) — composes a named agent.

Late binding through %data parameters lets the same imported task serve multiple callers — the data shapes are checked at the point of call.

What the compiler enforces

The grammar is intentionally small. The compiler enforces:

  • Every header line begins with a valid meta-character.
  • Every space declares a type tag.
  • Every reference (@, #, $, %, =) resolves to a declared identifier.
  • Every :FUNC space declares $func_main; every :AGENTIC space declares $agentic_main.
  • Persistent writes occur only in :DATA spaces.
  • :UI and :IO spaces emit only declared events.
  • path= is mandatory on every $data_reader / $data_writer call.

Anything that violates these rules fails at compile time, with a line number.