What is Chord?
Chord is a modeling language for parser interactive fiction. You describe the
world of your story as a set of plain facts — this room exists, it is dark
while the player carries the cloak, this exit leads west — and the compiler
checks those facts before anyone plays. A story is one .story file. There is
no project scaffold, no package manifest, and no build configuration.
What a story looks like
create the Foyer Bar
a room, dark while the player has the velvet cloak
aka bar
The bar, much rougher than you'd have guessed after the opulence of
the foyer to the north, is completely empty.
after entering it while in-darkness
phrase stumble
first time
change the message to trampled
end after
That is the whole definition of a room: what it is, when it is dark, what it is called, how it reads, and what happens the first time you stumble into it in the dark. The description is simply the paragraph written inside the block.
"Modeling language" is the important part
Chord is deliberately not a general-purpose programming language. It has no user-defined functions, no arithmetic expression language, and no imperative control flow. Every line is a statement about the world or about what happens in response to play.
That constraint is what buys the checking. Because the velvet cloak is a
declared thing rather than a string, the compiler knows when you misspell it.
Because in-darkness is a named condition, the compiler knows when you test a
state nothing can ever produce. Names, states, and conversation topics are all
resolved at compile time, so the class of bug where a story is quietly broken
in a room the author never revisited is a compile error instead.
The trade is real and worth stating plainly: a general-purpose language would let you write anything, and Chord will occasionally tell you that the thing you want is not expressible as a fact about the world. When that happens you can drop to Sharpee, the TypeScript platform underneath, without leaving the story.
What is in the language
- Things and rooms —
create the X, composed from kinds, traits, and settings rather than a class hierarchy - Prose — descriptions are paragraphs, not string literals; blank lines are paragraph breaks
- Exits — declared on the room, including blocked exits with their own refusal message
- Named conditions — give a world state a name once, then read it as English wherever it is tested
- Event clauses —
after entering it while in-darkness, with ordinal forms likefirst timeandthird time - People and conversation — topics, patrols, and scheduled behavior
- Opt-in systems — a
useline enables scoring with its rank ladder, hunger, and other subsystems, and only then does their vocabulary exist
The language is line-oriented and structured by indentation. Blocks open with a
header line and close at a dedent or an explicit end. Indentation is spaces;
a tab is an error.
Getting it
Most authors use Chord Writer, the macOS application: it carries the whole toolchain, highlights as you type, shows compiler problems live in a panel, and builds a playable browser version in one step. No terminal required.
If you would rather work from a terminal, the CLI installs from npm — see Install.
Where to go next
| If you want to | Go to |
|---|---|
| Write your first story | Getting started |
| Learn the language properly | The world |
| Copy a working pattern | Cookbook |
| Look up exact syntax | Grammar reference |
| See what runs underneath | What is Sharpee? |
| Just play something first | Play |