0. Introduction and conventions
Draws on: ADR 0009, ADR 0018, ADR 0028, ADR 0032, ADR 0039, ADR 0071.
This is the Spec of NorthTalk, a HyperTalk-descended scripting language for running untrusted end-user Scripts in a sandbox inside Go servers, Bun servers and browsers. It states every rule of the language once, in its final form. Together with the Conformance Corpus, it is the authority on what the language does. There are two Cores, one in Go and one in TS. Neither is the reference, and both answer to the Spec and the corpus, bit for bit (ADR 0009).
The ADRs in docs/adr/ record why each rule is the way it is, and what was rejected. The Spec cites them only for reasons. Where the Spec and an ADR disagree, the Spec wins. The tour is an informative introduction.
Name and source files
Section titled “Name and source files”The language’s public name is NorthTalk. Script and Library source files use the .talk extension (ADR 0039).
Versions
Section titled “Versions”This is language 1.0-rc.4, with Cost Model 0.
The language version is the Spec’s version. It pins the grammar, the Unicode version, the Unit Catalogue and the other catalogues, the display form and the Trace grammar (ADR 0018). The Cost Model has a version of its own, which also covers the Abstract Machine, since a change to the lowering changes Fuel.
The Spec is handed off as language 1.0-rc.4 with a provisional Cost Model 0. Language 1.0 is declared once both Cores pass the seed corpus and Cost Model 1 has been calibrated against them (ADR 0032).
Language 1.0-rc.2 breaks compatibility with earlier prereleases: reusable text/date Format Templates require ${…} and use $$ for a literal dollar; bare braces are ordinary text. Update templates and regenerate pinned Library identities, saved-state compatibility keys and corpus expectations. Ordinary quoted text is unchanged.
Language 1.0-rc.3 adds Nothing defaults (a otherwise b) and optional map-key reads (the optional k of m), and breaks compatibility with 1.0-rc.2: otherwise can no longer be an Argument Label, and an index variable named otherwise needs parentheses, as in item (otherwise) of xs (chapter 4). Rename the labels in declarations, event heads, calls, pass and target-first sends, and update dynamic Selector strings and Host message producers and consumers together, since an old send can silently select another message. A 1.0-rc.2 save is a mismatch under chapter 10. Regenerate pinned Library identities and corpus expectations.
Language 1.0-rc.4 adds Paths (ADR 0184): Path Literals such as /reviews/2/name, the at operator and Path Patterns, and breaks compatibility with 1.0-rc.3: an error’s path field is now a Path rather than a list, so destructure it with err's path as list, and json’s pointerPath gives a Path. Update Host message producers and consumers for the new path Value Encoding kind. A 1.0-rc.3 save is a mismatch under chapter 10. Regenerate pinned Library identities and corpus expectations.
Before language 1.0, lowering changes may accompany a language prerelease while provisional Cost Model 0 stays at 0; Cost Model 1 remains reserved for calibration (chapter 8).
What is normative
Section titled “What is normative”- Normative by default: every sentence in a chapter is a rule both Cores must follow, unless it is marked informative.
- Informative blocks: a blockquote that starts with a bold label is informative. There are three labels:
> **Note.**for a remark that helps a reader and adds no rule.> **Example.**for an example. The rule it illustrates is stated elsewhere.> **Rationale.**for a short reason, where citing an ADR isn’t enough.
- Also informative: the “Draws on” line under each chapter’s title, and Appendices A to C.
- Outside parity: each chapter ends with an “Outside parity” list of the freedoms that apply to it, where the Cores or the tooling may differ (ADR 0028). Everything not on such a list is covered by parity.
- Data Files: a table both Cores must agree on lives in a Data File under
spec/data/, and the Data File is the truth. A chapter shows it through a generated region (below). The two are kept identical, and a change where they differ fails CI.
Citing ADRs
Section titled “Citing ADRs”- A rule is stated in full here. An ADR is cited only for why, never for what. A citation is a link, as in ADR 0017.
- Draws on: a chapter’s “Draws on” line lists every ADR its rules come from.
- Issues are cited by number, as in #72.
- Changing the Spec: a decision gets a new ADR, and the same change edits the Spec. A narrowing is a new ADR that cites the one it narrows. A small fix can be a Spec-only change. ADRs 0001 to 0032 are left as they are (ADR 0032).
- No garbage collection: every rule must be implementable without garbage collection, and without anything a language’s runtime provides, such as exceptions, a scheduler or locale libraries, so that a third Core stays possible (ADR 0071).
Notations
Section titled “Notations”-
Terms: a capitalised term, such as Script, Handler or Run, has the meaning Appendix A gives it.
-
Source code is written in
talkcode blocks. A comment after an expression shows the value it gives, in the display form:put 0.1 + 0.2 into x -- 0.3 -
Values in prose are written in their display form (ADR 0018), such as
2.50 GBP,2026-09-27or"text". -
Error Codes are written in code font, such as
can't convert. -
Grammar productions are written in the EBNF notation of the W3C XML Recommendation, and live in
grammar.ebnf, or intrace.ebnffor the display form, Traces and Session Transcripts. -
Data Files are cited by path, such as
spec/data/errors.toml. -
Corpus cases are cited by path, such as
corpus/examples/orders-pricing/.
Generated regions
Section titled “Generated regions”A region written as <!-- generated: name --> … <!-- end --> is filled from the Data Files, or from GLOSSARY.md for Appendix A, so it is never edited by hand. The generator lives in tools/spec/.
bun run spec:genvalidates each Data File against its schema inspec/data/schema/, runs the checks between Data Files, checks every relative link and literalbun runscript reference in the repo’s Markdown files, and rewrites every region.bun run spec:checkruns the same checks, and fails if any region is out of date instead of rewriting it. CI runs it on every pull request.
Documentation commands run from the repository root. For a workspace-only script, use bun run --cwd path/to/workspace <script>. Script-reference validation checks literal names against that directory’s package.json; it does not execute examples or interpret shell state such as cd, variables or pipelines.
Outside parity
Section titled “Outside parity”None.