---
title: The glyphs
description: Stoic has no keywords. It has seventeen glyphs, each with one job. Here is every one, with an example the compiler reads back.
kicker: Write
---

# The glyphs

Stoic has no vocabulary. Every tag, field, event, handler and capability is a word you choose, passed through verbatim for the reader to interpret, person or agent. What is fixed is a small set of glyphs, and each has exactly one job. Most are borrowed from things you already read: HTML's angle brackets, a shell's `&`, a pointer's `->`.

They fall into four families: **structure** (what exists), **behaviour** (what happens), **firmness** (how strictly it holds) and **tests** (how we'll know).

## Element

`<tag … />` or `<tag> children </tag>` is a thing. A button, a table, a service, a pipeline step, a module's method. Leaving one unclosed at the end of a file is a warning.

```stoic
<gallery>
  <card />
</gallery>
```

## Name

`:name` names an element, so it can be reused with `->`, tested with `<test:… =name>`, or referred to by a field. Names are unique within a file, and within one lock a name is defined once.

```stoic
<button:like @click="like the post" />
```

## Bind

`=` after a tag binds an element to data or state. On a field, `=` gives a value, and when that value names another element it is a reference, not a copy.

```stoic
<table:orders=postgres #region="eu-west-1" />
<query:recent=orders @run="orders placed in the last day" />
```

## Reuse

`->` makes a copy of another element to adjust, in this file or another (`->ui.buttons.primary` is `primary` in `ui/buttons.stoic`). `#-name` and `@-name` leave a field or event out.

```stoic
<service:api #replicas(>=3) @crash="page oncall" />
<service:worker->api @-crash />
```

## Repeat

`*` after a tag means one per entry of the parent's data. The parent's actions apply to each one.

```stoic
<list=todos #more([done, delete])>
  <row* @click="open todo" />
</list>
```

## Field

`#name(…)` is a property and its rules: limits (`>=3`), quoted matches (`"email"`), must-not-contain (`!" "`), capabilities (`sort`, `filter`) and actions (`[add, remove]`).

```stoic
<form #username(>=3, <=20, !" ") #created(sort, filter) />
```

## Event

`@name="…"` is a trigger and what it does, in plain words. `@*` is every event. The handler is passed to the implementer verbatim, so write it the way you'd say it.

```stoic
<pipeline @push="run checks" @tag="release to production" />
```

## Note

A quoted string touching a word, with no space, fine-tunes that word. Notes go wherever detail matters: tags, events, fields, capabilities and actions. With a space it's an error, so you can't attach one by accident.

```stoic
<button"pill shaped" @click"debounce 300ms"="save draft" />
```

## How it runs {#modifiers}

Between `@` and the event: `~` is an animation (`~+` quick, `~-` slow) and `&` runs in the background, like `&` in a shell. They combine: `@&~click`.

```stoic
<card @~hover @&open="prefetch the photo" />
```

## Strict

`!` touching a name: no exceptions. On an element, it's the default for everything inside it.

```stoic
<form!:payment #amount(>0) #note(<=140) />
```

## Can bend {#bend}

`?` touching a name: a preference, not a rule. Tests don't bend: a `?` field's examples are still tests.

```stoic
<form #bio?(<=500) #name(>=1) />
```

## Or-value {#or}

`|value` is a value the field takes whatever its limits say: `#cycles(>=1, |null)` reads "must be at least 1, or null".

```stoic
<job #retries(>=1, <=5, |null) />
```

## Examples

`+"…"` must be accepted and `-"…"` rejected. `+=1` and `-=1.5` are values rather than text. Each example is a test, with an ID like `signup_username_rejects_ad`. `+=>="…"` and `-=>="…"` say what accepting and rejecting reports, as checked values.

```stoic
<form:signup #username(>=3, +"ada", -"ad", +=>="'ok'", -=>="'TOO_SHORT'") />
```

## Given

`^"…"` is a step that has already happened before a test's action, as many as it takes, in order. Among a field's arguments, it's how each of the field's examples is tried.

```stoic
<cart:c @add="add an item" />
<test:full=c ^"99 items in the cart" @add =>="'FULL'" />
```

## Expect

`=>"…"` is what must happen and `=>!"…"` what must not. These are guidance for whoever writes the test: verify only sees whether it passed. They're marked *(not checked)* everywhere they're printed, honestly.

```stoic
<form:f @submit="save" />
<test:saves=f @submit =>"saved" =>!"error shown" =>status="201" />
```

## Checked value {#checked}

`=>="…"` (or `=>label="…"` when a test has several) is the glyph that does the enforcing. The test reports the value it observed, and verify compares it with the locked one, as a value: numbers by value, objects in any key order. A test body can be wrong. Its observation can't hide.

```stoic
<method:fee @call="8.75% of amount, rounded half to even" />
<test:fee600=fee @call="600" =>fee="52" />
```

## Kept comment {#kept}

`<!-- … -->` is private and never appears in any output. `<!--! … -->` is kept: guidance for the implementer, for what a rule can't say. It belongs to the element it's in or right before, or to the whole file when it stands alone.

```stoic
<!--! Left open: whether emails are trimmed. Your choice. -->

<form #email("email") />
```

## Your words {#yours}

Everything else is yours. `<gallery>`, `<chip>`, `@tap`, `@clk` and `#vibe` are as valid as `<table>` and `@click`. Stoic never checks a name against a vocabulary, because the reader, a person or a model, already knows what a gallery is.

```stoic
<ritual:morning @dawn="make coffee, then read" #duration(<=30) />
```
