Thym 0: the MacroCOSM language, its compiler and its runtime
Version 0 of the language, written 2026-11-01 for enough 0.5.0
Outline
- Contents — every section of this specification, in order
- How to read this — the rule words, the family of words, and what a block promises
- 1 Provenance and the name — where Thym comes from, how it is said, and who keeps it
- 1.1 Lineage — MacroCOSM OES 0.0.1 gave enough one grammar for volumes of items
- 1.2 The name — Thym is said THIGH-m
- 1.3 Stewardship — The owner of enough keeps this specification
- 2 The model on one page — programs compose moves over typed values; a compiler plans; a runtime runs and traces
- 3 The design rules — seven rules every choice in this document answers to
- 4 Programs: the language — the file, its blocks, its heads and statements, and the grammar in full
- 4.1 The file — A program file has the extension .thym
- 4.2 Blocks — A file holds four kinds of top-level block, each closed by end
- 4.3 Heads — A head is a line at the start of a block, before any statement
- 4.4 Statements — Statements, in Programs: the language
- 4.5 Expressions and modifiers — An expression is a move call, a name, a literal, a field read
- 4.6 Literals — Literals, in Programs: the language
- 4.7 Keywords — Every keyword is a FEED headword or a form of one
- 4.8 The grammar in full — MOVENAME is a name that a manifest or a move block declares
- 5 Values and types — documents typed by density, each carrying what it was made from
- 5.1 The types — The nine meaning types are text fabula short atem item volume morph graph package
- 5.2 Densities and what fits where — The four densities, text, fabula, short and atem, are types
- 5.3 Provenance — Every meaning value a move makes carries the move, its inputs' digests, the run
- 5.4 Bindings — let binds a name once, in the block where it appears
- 6 Moves — the primitives: a signature, an asks flag, a contract, and the MiniCOSM that owns each
- 6.1 What a move is — A move is one step, a transcoding or a transcognition, with four parts: a signature
- 6.2 Who declares what — Section 17.6 gives the moves: block that declares them
- 6.3 The standard moves of version 0 — Each contract below is the contract: list of the move's declaration
- 6.4 Signatures in the manifest — A move's declaration is one mapping in a moves: list (section 17.6)
- 7 Contracts and the six laws — named checks on a move's output, six of which every implementation keeps
- 7.1 What a contract is — A contract is a list of named checks that must hold on a move's output…
- 7.2 The six laws — The six laws, in Contracts and the six laws
- 7.3 The named checks — The named checks, in Contracts and the six laws
- 7.4 assert — An assert line adds a check of the program's own
- 8 Control flow, bindings, user moves, use — one choice, one loop, one output; moves that call moves; files that lend their moves
- 8.1 Choice and loop — if … then … else … end chooses
- 8.2 Three ways out — give gives the block's value, and every path of a block that gives must reach…
- 8.3 User moves — A move block is a named program with parameters
- 8.4 use — A use line stands outside every block, usually just after the version line
- 9 Errors: compile, plan, run — three kinds at three times, each refusing whole, each with the line
- 10 Programs as documents — a program enumerated into items, read at three densities, compiled back byte for byte
- 11 The compiler — seven stages, each refusing whole, ending in items and a plan a person can inspect
- 11.1 The stages — The nodes of a plan come in evaluation order
- 11.2 The package — enough/thym/ is one Python package
- 11.3 The command line — Every command reads ENOUGH_THYM_ROOT (default ~/enough/thym/) for where runs live
- 12 The runtime — a plan walked in order; the model as a contracted coprocessor; every run traced and replayable
- 12.1 Execution — run takes a plan and the program it was made from
- 12.2 The coprocessor — One interface; three implementations in enough; any number elsewhere
- 12.3 Traces — A run writes one thym/1 volume of kind trace
- 12.4 Replay — run --replay <run-id> runs that run's plan with the ReplayCoprocessor
- 12.5 Budgets and the 16 GB rule — A plan carries the largest prompt it will build
- 12.6 Portability — No Python-only semantics
- 13 The null morph, the ten scales, morphs — the plainest telling as the reference, and a morph as a measured departure from it
- 13.1 The null morph — The null morph is Thym's reference telling of a fabula
- 13.2 The ten scales — Each scale is an integer from 1 to 5
- 13.3 Measurement — Ratios are per hundred or per thousand words, compared as integers
- 13.4 Holomorph and isomorph — A holomorph is measure t against null of f
- 13.5 Morph blocks and morph items — A morph may be declared by hand in a program file, one scale per line
- 14 Readings — someone else's fabula told in your morph: local, labelled, never the source
- 15 Packages — the self-contained export of a text, in a folder, in one file, or encrypted
- 15.1 Folder form — <name>.thym/ (a folder; a program is a file of the same suffix, <name>.thym…
- 15.2 The catalog — The catalog, in Packages
- 15.3 Single-file and encrypted forms — package lands the single-file form, with the folder form <name>.thym/ beside it
- 15.4 The laws of a package — The author's text is the package's telling as told
- 16 Context — the volume a text lives in, and the occasion it is read on
- 16.1 Surrounding context — The surrounding context is the volume a text sits in
- 16.2 Occasional context — The occasional context is just-in-time
- 17 The thym/1 MiniCOSM and the moves: block — the MiniCOSM that holds programs, morphs, contexts, plans, traces and packages; and how any MiniCOSM declares moves
- 17.1 The catalog — A thym/1 volume is one file
- 17.2 The modules and their kinds — Kinds are unique across the modules, as in every MiniCOSM
- 17.3 Ids and the fields of each kind — <module>:<kind>/<slug>, with the slug grammar of doc/1
- 17.4 Checks — The envelope checks the generic reader runs, and six of thym/1's own, which enough/thym runs
- 17.5 Renderers — program (the file compiled back; lens {kind: short, order: told}), plan
- 17.6 The moves: block — Any MiniCOSM's manifest may carry a moves: list
- 18 Projections: the dial as a program — an isotype is a holotype transcoded by a program whose contracts are the target schema's rules
- 19 Agent-free — with the agent off, only deterministic plans run, and scaffolds stand in where they are honest
- 20 Conformance — what a compiler and a runtime must do, and the suite that shows it
- 20.1 A compiler must — A compiler must, in Conformance
- 20.2 A runtime must — A runtime must, in Conformance
- 20.3 The suite — tests/fixtures/thym/ in enough-dev, portable as a folder together with tests/fixtures/cosm/, MacroCOSM's own corpus
- 20.4 Where the reference wins — The reference landed on 2026-11-01 and passed checkpoint A
- 21 Decisions in this version — the decisions version 0 settled, one numbered line each
- 22 Open questions and roadmap — what version 0 leaves for the round, and what waits for a later version
- Colophon — Written 2026-11-01 for enough 0.5.0, version 0 of the language
Glossary
- a company (Comprise)
- a company (Comprise), called holotype in the files — defined in How to read this
- a person (Ascribe)
- a person (Ascribe), called holograph in the files — defined in How to read this
- compile
- a parse error (parse); a version line that is not thym 0 (version) — defined in §9 Errors: compile, plan, run
- holomorph
- measure t against null of f, for a person's text t with fabula f — defined in §13.4 Holomorph and isomorph
- isomorph
- a holomorph the owner chose to share — defined in §13.4 Holomorph and isomorph
- null morph
- Thym's reference telling of a fabula — defined in §13.1 The null morph
- occasional context
- just-in-time: why this text, for whom, in what medium, at what moment, under what constraints — defined in §16.2 Occasional context
- plan
- a model-backed node while agent-free (agent-free, section 19); a prompt the machine's model cannot hold — defined in §9 Errors: compile, plan, run
- reading
- read f with m in c: a telling of a fabula in the reader's morph — defined in §14 Readings
- run
- a model-backed output that still fails its contract after narrow repair and its budget… — defined in §9 Errors: compile, plan, run
- surrounding context
- the volume a text sits in — defined in §16.1 Surrounding context
- Thym
- said THIGH-m: thigh with an m on the end, after Fukuyama's thymos — defined in §1.2 The name