The premise
The conceit is a constraint, not a costume. Every design question gets answered by asking what this civilisation would actually have built, and the answers are frequently better than the ones we got: no floating point, no delete, and a calendar that is genuinely better at being a calendar than the one on your phone.
Two rules run through everything. There are no Arabic digits anywhere a reader can see. And the machine never approximates on its own initiative — where a result cannot be written exactly, the program has to say how much precision it is willing to carry.
Anything written here in dotted form, like 13.0.13.16.14, is Thompson notation: a
twentieth-century scholarly convention for transliterating numbers into Arabic digits. It is used
in this documentation and in error messages meant for developers. It is not something a reader of
Maya OS ever sees.
Numbers
Base twenty, positional, three marks. A dot is one, a bar is five, and zero is a shell — one of the few independent inventions of zero in human history, and a good thing for an operating system to be founded on.
Notation has no sign
This is a real constraint, not an oversight to patch over. It is answered in two places.
Machine words use twenties-complement, the base-twenty analogue of the
tens-complement real decimal computers used and of the two's complement binary ones use. A word is
negative exactly when its leading digit is ten or more, so the sign test is a single comparison —
which is what a sign test ought to be. Negative one is 19.19.19.19.19.
Written quantities take an invented marker, ma', from the Yucatec negative particle.
It is an invention and is labelled as one everywhere it appears.
The word is a pik
Five digits, because the Long Count already uses five places, so the machine and the calendar agree on the shape of a word. That is 205 = 3,200,000 values, signed from −1,600,000 to 1,599,999.
There is no floating point
None, and no way to make one. Non-integers are exact rationals. A third is a third forever, and every consequence of that is an improvement:
- No IEEE, no NaN, no negative zero, no infinity.
- Division by zero is an error. That is the whole of it.
0.1 + 0.2is not a famous problem here. It is not even writable.- The square root of two has no value, because it genuinely does not have one.
That last one is the interesting case. A caller who wants a number must name the denominator they will carry, and the system answers the question actually asked: given that bound, what is the nearest quantity that can be written?
Time
The Long Count runs k'in, winal, tun, k'atun, b'ak'tun. Everything anchors on 0.0.0.0.0 = 4 Ajaw 8 Kumk'u, 11 August 3114 BCE in the proleptic Gregorian calendar, under the Goodman–Martinez–Thompson correlation constant of 584283 — the one under which 13.0.0.0.0 falls on 21 December 2012.
The one irregularity in the whole system
Eighteen winal make a tun, not twenty, so that a tun lands near a solar year. It is the single
place where the count is not vigesimal, and it is why the calendar cannot share a package with
the arithmetic: read as pure base twenty, 13.0.13.16.14 is 2,085,534, but read as a
Long Count it is 1,877,014 days. A test asserts both, so the boundary cannot quietly erode.
Alongside the Long Count run the 260-day Tzolk'in (thirteen numbers against twenty day names) and the 365-day Haab' (eighteen months of twenty days, plus the five-day Wayeb'). They mesh into the Calendar Round, which returns every 18,980 days — fifty-two Haab'. Only 18,980 of the 94,900 possible pairings ever occur, because the two cycle lengths share a factor of five.
Haab' days are numbered from zero, which is not a programmer's convenience: the first day of a month is its seating, the month taking its seat, so zero-based is the authentic reading.
Also implemented: distance numbers, which monuments carve lowest place first so a reader knows at once they are looking at a span rather than a date; and the Lord of the Night, the nine-day cycle carved in the Supplementary Series.
Units below the day, which had to be invented
The Maya counted days and everything above them. They had no hour, because nothing in their system needed one. A computer does. The Long Count names the units above a k'in as burdens carried on a tumpline; below it the logic inverts, because things shorter than a day are motions rather than loads, and the series descends through what a body can perceive.
| Unit | Value | Duration | Root |
|---|---|---|---|
| k'in | 1 | 24 h | day, sun |
| p'iis | k'in/20 | 72 min | to measure |
| xíim | /400 | 3.6 min | to walk |
| iik' | /8 000 | 10.8 s | breath, wind |
| muts' | /160 000 | 0.54 s | to blink |
| tíip' | /3 200 000 | 27 ms | to flash forth |
| sáas | /64 000 000 | 1.35 ms | light |
Every unit divides a day exactly, so no conversion here ever rounds. The clock is three digits,
p'iis:xíim:iik', which lands within eleven seconds of any instant. A timestamp is
iik' since 0.0.0.0.0 — about 1.5 × 1010 today, which needs eight digits and so rides in
a double word.
The roots are Yucatec and the meanings are sound. The orthography wants a pass against a proper dictionary before it is treated as settled.
The terminal
Maya writing is not a line of characters. It is glyph blocks arranged in a grid and read in paired columns, and positional numerals run vertically, most significant on top. A line-of-characters terminal fights both, so the substrate changes instead: the screen is a canvas grid of glyph blocks, and there is no xterm.js anywhere in it.
Geometry
| Unit | Size | Holds |
|---|---|---|
| quantum | 12 × 24 px | one romanised character |
| band | 2 or 3 quanta tall | the canonical row |
| block | square, one band tall | one vigesimal digit or one Maya sign |
Block width scales with band height and is not a constant. A quantum is twice as tall as it is wide, so two quanta of width per quantum of height keeps a block square at any setting: 4 × 2 quanta at a band of two, 6 × 3 at a band of three. At 1200 × 800 that gives 100 × 33 in line regime and 25 × 16 in block regime. The density drop is the central tension of the whole interface, and every layout decision follows from it.
Two registers, which is how the Maya did it
A five-digit vertical number is five blocks tall and a line of prose is one band. They cannot coexist inline, and no layout trick changes that. The resolution is genre, and it is authentic: monuments carve vertically in paired columns, and the codices write tables in horizontal rows.
- Codex register — the shell, code, calculators, tables. Horizontal runs of blocks, each digit internally vertical.
- Monumental register — the calendar, the stela, the codex reader. True vertical stacks, optionally in paired reading order.
Bar-and-dot is the plain register. Above it sit the head variants — a portrait glyph for each number from zero to nineteen — and above those the full-figure forms. Same data, three levels of ceremony, exactly as inscription practice worked.
Carving a number
A number is built from its marks, not typed, because that is what a bar-and-dot system is: you are not spelling a number, you are carving it.
| Key | Mark |
|---|---|
| F4 | begin or end a carving |
| - | a bar, worth five. Never more than three |
| . | a dot, worth one. Never more than four |
| ; | a shell, which commits a zero at once |
| space | finish this digit and begin the next |
| F9 | in the scribe, write the file |
| F2 | change the band height, anywhere in the system |
Nineteen is ---..... A fourth bar would be a digit of twenty, and there is no such
thing. The command line is a whole band tall, so a carved digit sits inline in the
prompt — which is what the band model was designed for. Scrollback lines holding no
carving stay a single quantum tall, so plain text costs nothing extra.
The shell
Chilam is a spokesman: the one who interprets what is said and says it back in words people use. Every name also answers to an ASCII spelling, because a keyboard that cannot type an apostrophe should not lock a reader out of their own machine.
| Word | Means | Does |
|---|---|---|
| il | to see | list what a house holds |
| bin | to go | enter a house |
| tu'ux | where | say where you are |
| xok | to read, to count | read a file, or count a carving |
| ts'íib | to write | write a file |
| much' | to gather | make a house |
| sáat | to let go | send a thing down to Xibalba |
| ajtz'ib | scribe | the editor |
| woj | letter, sign | the writing itself, and whose hand drew it |
| ajk'in | day-keeper | the calendar |
| k'in | day, sun | what day it is |
| máax | who | who is here |
| áantaj | help | what can be said |
xok doing two jobs is not a pun. The word means both to read and to count, so given
a file it reads and given a carving it counts.
Nothing is destroyed
sáat does not unlink. It sends a thing down to Xibalba, the
underworld, where it can be found and raised again. A name already taken below is not
overwritten — the newcomer is stamped with the Long Count of its descent, because two things let
go on different days are different things. A system whose premise is that time is cyclical
should not be able to destroy anything.
The glyphs
Everything else this system draws is geometry it invents. Bars and dots are geometry, the head variants are geometry, and the syllabary is geometry pretending to be signs. The glyph catalogue is the first real Maya writing here: a hundred drawings from Wikimedia Commons, made by people.
What maps, and what does not
The twenty Tzolk'in day signs map exactly, and they come in two variants, monumental and codex — the same split the terminal's two registers already draw. So the register a reader is in decides which drawing of a day they see. Paired columns keep the monumental drawing, because paired columns are a way of arranging a monument rather than a third way of drawing a sign.
The other eighty are real writing — emblem glyphs and miscellany — with no place in this system's semantics. They are in the catalogue and can be looked at, and nothing resolves to them. Ten of the thirty-two signs that name an account now have real drawings too, from a second download; the other twenty-two are still invented geometry, and the door shows all of them side by side so the difference is plain rather than hidden. Which is which is stated rather than blurred: a catalogue that quietly passed an emblem glyph off as a syllable would be worse than no catalogue.
Attribution is a condition, not a courtesy
Most of these drawings are licensed CC BY-SA 4.0 or 3.0; the rest are public domain or CC0. Share-alike means the credit has to travel with the work, so it does: the author and licence are embedded beside the art rather than kept in a file that could be dropped, the server serves glyphs only from that embedded catalogue and so cannot serve one whose licence did not ship with it, the author and licence ride in the response headers of every glyph fetched, and the calendar prints the hand that drew a sign underneath the sign itself.
The full catalogue, with every author, licence and source link, is at
/glyph/credits.json, and woj all lists it in the shell.
How a glyph reaches the screen
A glyph is the one block this system does not generate, so it has to be fetched. A cell names a catalogue id, the display loads that drawing once and keeps it, and paints it fitted to the block with its own proportions kept — stretching somebody's artwork to fill a square would be a poor way to treat it. When the ink is light the drawing is inverted, so it reads on carved stone at night as well as on bark paper. Until it arrives, its block is a faint frame, so a reader can see that something belongs there.
Accounts and the door
A name and a password are not typed in the roman alphabet. Every connection opens on
jol ("the door", internal/jol), a syllabary keyboard on the right of
the screen, and an account is a sequence of real syllabic signs (pkg/mayasign, from
Macri & Looper's chart of attested values) chosen from it — not an English string run through a
Maya-styled font. The geometry each sign is drawn with — a frame, a count of radiating ticks, a
centre dot or not, thirty-two combinations for thirty-two values — is this system's own invention,
the same "pure geometry, no font" move bar-and-dot digits already make. Only the deployment's own
access token stays plain typed text, masked, because it is an operational secret, not an identity.
An account's name is a Tzolk'in day sign taken from its creation date, and a password is
bcrypt-hashed, never stored in the clear. Registration is gated by an access token
(MAYA_ACCESS_TOKEN) while there is no wider invitation system yet.
A signed-in reader's filesystem persists in pkg/kanan, one guarded file per key, and
reloads on login. It is saved again every thirty seconds and on disconnect, so a restart costs at
most that much of a session, never the whole thing.
stela is the public monument accounts make possible: append-only and
stamped with the Long Count of the moment it was carved. There is no edit and no delete — there is
no method that would let there be one.
Utilities
Past the shell's own vocabulary sit a handful of self-contained programs, each pushed onto the
terminal's own utility stack the way ajk'in already is.
| Command | Opens |
|---|---|
| fortune [day|all] | a day sign's own long-recorded association |
| venus | the Dresden Codex Venus table |
| eclipse | the Dresden Codex eclipse table |
| mars | the Dresden Codex Mars table |
| kawiil | the 819-day count, four coloured stations |
| k'iwik [take <name>] | the market: example Kan programs to bring home |
| loom | a cellular automaton, woven one row at a time |
| man [topic] | the codex folios — what each command is for, at length |
| bearer | what is open right now, as burdens on a tumpline |
| pok-ta-pok | a small hip-strike rally — not the real rules |
fortune
Reads a day sign's own long-recorded association — what it depicts and the character recorded for it — drawn from Yucatec sources for all twenty, not invented for this system. It says outright that this is the sign's own association, not a prophecy the machine computed.
The Venus and eclipse tables
Two Dresden Codex instruments, opened with venus and eclipse and pushed
with the same shape of keys: h/l a day, J/K a
whole cycle, t today, p a preview that fast-forwards the cycle so its
shape is something a reader watches rather than steps through by hand.
venus divides the codex's own synodic period into its four stations — morning star,
superior conjunction, evening star, inferior conjunction — plus the two commensurations that make it
a calendar instrument rather than only an astronomical one.
eclipse works in a different clock — lunations against the moon's own nodes rather
than a synodic period — and states the codex's own totals: sixty-nine marked dates, sixty-eight
intervals, four hundred five lunations, eleven thousand nine hundred sixty days, which is forty-six
Tzolk'in rounds exactly.
man
man with no argument carves an index of every folio; man <topic>
opens one, wrapped into two columns the way an opened codex page is actually read — top to bottom in
the left column before the eye moves to the right one. The corpus, one folio per command, is this
system's own documentation, not Maya writing, and says so.
bearer
Draws a session's own utility stack — what is pushed open, nested one inside another — as bearers
carrying burdens in relay, the actual Maya metaphor for how a time period is carried from one bearer
to the next. The one in front carries its burden "in hand"; everything beneath waits its turn; the
bottom is the root nothing else carries. A buried utility still computing — venus,
eclipse or loom's own preview, left playing — is marked "still moving on
its own, unseen" instead. F6 opens bearer over whatever utility is already
on screen without popping it first, the same "press it again to leave" shape F4's own
carving toggle uses.
loom
Draws an elementary cellular automaton — Wolfram's rule numbers 0 to 255 — one row at a time, each
computed from the row before it. h/l step the rule by one,
J/K by sixteen, F4 carves a rule number directly in
bar-and-dot, r toggles a single seed against a random row, space weaves
one row by hand, u unweaves the last, p plays or pauses the automatic
weave. It draws the shape of a real backstrap loom's row-by-row construction honestly, and says just
as plainly that the motif is Rule 90, not a reconstructed weaving pattern — a real weaver plans a
motif thread by thread, a fixed local rule does not.
pok-ta-pok
The obligatory game, built as an explicit small arcade rally rather than a reconstruction: no
primary source preserves a complete rule set for the real game (pitz, the Classic word the
package underneath is named for), so scoring, team size and win conditions here are this system's
own invention. A ball falls under gravity between two court walls; h/l
strike it from the left or right side, timed to whichever side it is actually falling on. A ring,
positioned the way Chichen Itza's Great Ballcourt is said to have used one, gives an instant win if
the ball passes through it while rising. It opens on a compressed telling of Hun Hunahpu and Vucub
Hunahpu's match against the Lords of Xibalba, and the Hero Twins' winning rematch.
Kan, the language
Kan is Python as this lineage would have written it. The name is Yucatec for snake, which is both the obvious joke and a real day in the Tzolk'in.
Numerals in source are resolved before Python's own parser sees them, because the Mayan numeral characters are in Unicode category No and Python's tokenizer rejects them outright. A scanner that knows where Python's strings and comments are resolves the numerals in code and leaves everything inside a string or a comment exactly as written. What comes out is ordinary Python.
Then two rewrites and one refusal. Division becomes exact, so one over three is a third rather
than a binary approximation of one. Exponentiation goes through the same door, since a negative
exponent on an integer is a float in Python and would smuggle one in. And a decimal literal is
refused outright — there is no decimal point in this number system and no Arabic digits to put
around one, so 0.5 is not a number that can be written, and the error says how to
write it instead.
A real program, and its real output:
# -*- coding: kan -*- DAYS_PER_WINAL = DAYS_PER_TUN = DAYS_PER_WINAL * year = rational(, ) print(DAYS_PER_TUN) # 360 print(DAYS_PER_TUN / year) # exactly 72/73 print(root(, )) # 99/70
The # -*- coding: kan -*- line is not decoration. Kan registers a real source
encoding through the mechanism PEP 263 provides for any other encoding, so a file marked this way
imports with its numerals already resolved.
Running it, sandboxed
kan <file>, c <file> and go <file> run a
reader's own program from the shell, each sandboxed under internal/pakal ("shield",
the name the seventh-century Palenque king Pakal took for himself): no syscall surface beyond one
staged directory built fresh per run, a fuel-metered instruction budget so a runaway loop cannot hang
the server, a wall-clock timeout as a second net, and a memory cap. Kan and Go both run as data fed
to a resident interpreter that is already sitting there — CPython-wasi for Kan, a small yaegi wrapper
(tools/yaegi-runtime) for Go — so neither reader's source is ever compiled by anything.
C has no such option: nothing readily available interprets C, so c compiles on the real
host with a fetched wasi-sdk, bounded by an ordinary wall-clock timeout and a scratch directory, and
only the compiled result runs under pakal — a narrower guarantee than the other two, and stated as
one rather than blurred into it.
Architecture
The Go server is the terminal emulator and the browser is a display. This falls out of the block model: nothing in the stack is a real VT220, so it should not pretend to be one. The server owns the block buffer and runs the utilities; the display draws blocks and reports keystrokes, and holds no application logic at all. That is how a thin client is supposed to work, and how the first timesharing systems actually did.
user program (WASM: Kan, C, Go)
│ stdout bytes
▼
Go terminal emulator ── block buffer, band grid, cursor
│ diffed block ops over WebSocket
▼
TS canvas renderer ── draws blocks, captures input
Nothing in the page scrolls and there is no scrollbar anywhere. The server owns the scrollback; the display sends a wheel as a number of lines and gets a screen back.
Frames carry only the cells that changed. Digits are drawn procedurally from their geometry — bars, dots and a shell — so there is no font, no asset pipeline, and a digit is exact at any size.
A block hides the quanta beneath it and a frame does not send them: the anchor carries the whole rectangle. Any client of this protocol has to lay the covered cells down itself, or whatever was there before goes on being drawn through the gaps between the bars.
Untrusted code runs as WASM under wasmtime (internal/pakal) rather
than in containers: no syscall surface beyond one staged directory, fuel-metered, a wall-clock
timeout as a second net, and a memory cap — one compiled module serving many isolated runs.
kan, c and go all run through it from the shell now; see
"Kan, the language" above.
What exists
- Numbers
- built, tested
- Calendar
- built, tested
- Block terminal
- built, tested
- Shell and filesystem
- built, tested
- Kan, C and Go
- built, tested
- WASM sandbox
- built, tested
- Accounts and persistence
- built, tested
- Astronomy, loom, man, bearer, pok-ta-pok
- built, tested
- Maya script glyphs
- day signs only
Kan, C and Go all run from the shell now, each sandboxed under
internal/pakal — see "Kan, the language" above. All twenty Tzolk'in day signs and ten
of the syllabary's thirty-two signs have real drawings; the rest of the glyph catalogue is still
this system's own geometry, and says so wherever it appears.
Maya script is logosyllabic and is not encoded in Unicode — proposals exist, nothing is standard — so a glyph layer means a custom font over the Private Use Area, with the roughly eighty common syllabograms as the tractable subset. The numerals are encoded, at U+1D2E0 to U+1D2F3, added in Unicode 11.0; font coverage in the wild is close to nonexistent, so those characters are used for source code and interchange while anything on screen is drawn from its geometry.
Open questions
- Band height of two quanta or three. Bigger blocks read better and cost a third of the rows.
F2switches it live, which is the only honest way to settle it. - Monumental reading order: true paired columns, which is authentic and genuinely disorienting to a modern reader, or a single column, which is readable and half-authentic.
- Whether the shell prompt should live in the codex or the monumental register.
- Yucatec orthography throughout, against a real dictionary.
- The Lord of the Night anchor — G9 at 0.0.0.0.0 — is the one part of the calendar taken on less certain footing than the rest. If it is wrong, one constant fixes it.
- The Haab' month signs, head-variant numerals from real drawings, and the other twenty-two syllabary signs are all still blocked on the same Wikimedia Commons egress wall every session since the glyph catalogue began has run into.
- A computation surviving a utility fully popped off the stack, or a reconnect, has no registry
anywhere in this system yet — the other half of a daemon lifecycle
F6's overlay key only began.