We are currently working on new rules for what content should and shouldn't be allowed on this website, and are looking for feedback! See Esolang:2026 topicality proposal to view and give feedback on the current draft.

Threescore

From Esolang
Jump to navigation Jump to search
Threescore
Paradigm(s) cellular automaton, self-modifying
Directed by User:Miui
Generated by Claude Opus 5
Appeared in 2026
Memory system cell-based
Dimensions one-dimensional
Computational class Unknown
Reference implementation threescore.py
File extension(s) .60

Threescore is an esoteric programming language in which every program is a sonnet and every sonnet is eaten alive by Rule 60.

The name is the archaic word for sixty, which is also the number of the elementary cellular automaton that rewrites the source code and the number of the Shakespeare sonnet the language is built out of:

Like as the waves make towards the pebbled shore,
So do our minutes hasten to their end;
Each changing place with that which goes before,
In sequent toil all forwards do contend.

A Threescore program does not have a fixed meaning. It has a life. The verse is read once from top to bottom; when the reading falls off the end of the fourteenth line, Rule 60 is applied to the whole poem and a different, later, worse poem is read instead. Programs are therefore written not to be correct but to become correct, and then to die.

Source format

A program is exactly fourteen lines of verse, each of exactly ten syllables. Blank lines are ignored, and a line beginning with % is a comment (the language has no other way to speak about itself). Anything else is a syntax error, and the interpreter is expected to say so in the manner of a disappointed schoolmaster.

Each syllable contributes one bit, so a program is exactly 14 × 10 = 140 bits.

Scansion

Syllables and stresses are decided mechanically, so that a poem has exactly one reading:

  • Apostrophes are deleted before anything else, so tow'rds is one syllable and crown'd is one. This is how the elision was printed in 1609 and it is how the poet controls the syllable count here.
  • Hyphens and spaces both separate words, so cru-el is two syllables and cruel is one.
  • A syllable is a maximal run of vowel letters (a e i o u y, plus accented vowels).
  • Silent e : if a word has two or more syllables and its last one is the single letter e at the end of the word, or e followed by a final s, that syllable is deleted — waves is one, make is one, minutes is two. The rule does not fire after a sibilant (s c z g x), so eclipses is three, nor when the vowel carries an accent, so belovèd is three and beloved is two.
  • A syllable is stressed (bit 1) if any vowel letter in it is written in upper case, and unstressed (bit 0) otherwise.

Only vowels carry stress marking, and ordinary capitalisation is not used: Threescore source is written in lower case throughout, like a scansion exercise rather than like a poem. A regular iambic pentameter therefore looks like

like As the wAves make tOw'rds the pEbbled shOre,

and scans as 0101010101.

The machine

The Shore
140 bits, the program itself, arranged as fourteen rows of ten and closed into a ring: the last syllable of line 14 is the left-hand neighbour of the first syllable of line 1. Each changing place with that which goes before.
The Sea
a doubly infinite tape of unbounded signed integers, all initially 0. This is the only memory Rule 60 cannot reach.
The Minute
a pointer into the Sea, initially at cell 0.
The Wave
the line currently being read, initially line 1.

Instructions

There are no instruction characters. The instruction on a line is the number of stressed syllables in that line as it currently stands — an integer from 0 to 10. A metrically perfect line is therefore a no-op, and a program only begins to do anything once Time has damaged it.

Stresses Name Effect
0 nothing Halt. And nothing stands but for his scythe to mow.
1 hasten Move the Minute one cell right.
2 crawl Move the Minute one cell left.
3 nativity Increment the cell under the Minute.
4 eclipse Decrement the cell under the Minute.
5 sequent Nothing happens. This is what a flawless line of iambic pentameter does.
6 praise Output the cell under the Minute, modulo 256, as a byte.
7 delve Read one byte of input into the cell under the Minute; 0 at end of input.
8 transfix If the cell under the Minute is 0, skip the next line.
9 defence If the cell under the Minute is not 0, leap back to line 1 without ageing the Shore.
10 mow Set the cell under the Minute to 0.

Ageing

After line 14 is read, the Wave returns to line 1 and the Shore ages by one application of Rule 60 around the ring:

shore[i] ← shore[i] XOR shore[i-1]

Rule 60 is the Rule 90 of the poor: it XORs each cell with its left neighbour only, which is multiplication by (1 + x) in GF(2)[x] / (x140 − 1), which is Pascal's triangle modulo 2 leaning to the right. Stresses spread rightwards down the poem, doubling and cancelling, until the verse says something quite different from what was written.

transfix ages the Shore too when its skip carries the Wave past line 14. defence is the one instruction that does not: a backwards leap to line 1 is a loop that Time does not notice, and it is the only way a Threescore program can repeat itself unaltered. Nothing 'gainst Time's scythe can make defence.

Properties

  • There are no fixed points but death. shore[i] = shore[i] XOR shore[i-1] for all i forces every cell to 0, and an all-zero Shore is fourteen lines of nothing. No program is stable; the best a program can do is loop with defence and never let the Wave reach the end.
  • Every program settles within four passes. On a ring of 140 cells the transient of Rule 60 is at most 4; after that the sequence of poems is exactly periodic.
  • Time's period is 16380. Almost every Shore has orbit length 16380 — a program is a slideshow of 16380 distinct sonnets before it repeats itself. Special Shores have periods dividing it (7, 15, 4095 and 1 all occur). Only the dead Shore has period 1.
  • A perfect sonnet lives exactly three passes. If every line is regular iambic pentameter, the Shore is 0101...; every pair of neighbours differs, so one ageing turns it to all ones (fourteen mows) and the next to all zeros (nothing). Fourteen lines of toil, fourteen lines of mowing, and then silence.
  • Control flow is thin. defence can only leap to line 1, so a program has at most one loop, its body must begin at line 1, and its test is at the bottom. Nesting is impossible within a pass. Everything else must be got by outliving the poem.

Examples

Sonnet 60

The canonical program, marked for the beat rather than for the speech. It toils for a pass, mows for a pass, and halts on the third: fourteen no-ops, fourteen zeroings of one untouched cell, and death. It produces no output, which is the correct output.

like As the wAves make tOw'rds the pEbbled shOre,
so dO our mInutes hAsten tO their End;
each chAnging plAce with thAt which gOes befOre,
in sEquent tOil all fOrwards dO contEnd.
natIvitY, once In the mAin of lIght,
crawls tO matUritY, where-wIth be'ng crOwn'd,
crookEd eclIpses gAinst his glOry fIght,
and tIme that gAve doth nOw his gIft confOund.
time dOth transfIx the flOurish sEt on Youth
and dElves the pArallEls in bEauty's brOw,
feeds On the rAritIes of nAture's trUth,
and nOthing stAnds but fOr his scYthe to mOw:
and Yet to tImes in hOpe my vErse shall stAnd,
praisIng thy wOrth, despIte his crU-el hAnd.

Echo (cat program)

Reads bytes and writes them back until end of input. Because defence on line 4 leaps backwards, the Wave never falls off the poem, the Shore never ages, and lines 5 to 14 are never read at all — they are there because a sonnet is fourteen lines whether or not fourteen lines are needed.

spEak: i tAke Up thY wOrd, hOld it, and wAit          7 delve
If nOught be thEre, pAss On; Else spEak It forth      8 transfix
thEn i gIve it bAck: it Is thIne agAin                6 praise
on, On: spEak, brEathe, sOund, crY, sIng, wEep, spEak, On   9 defence
and then be still, and let the silence come           0 nothing
these lAter lInes the wAve will nEver rEach           5 sequent
they lIe belOw the sUrface, cOld and stIll            5 sequent
and Yet they cOunt, for rUle sixtY will cOme          5 sequent
to tUrn them All to Ones, and thEn to nOne            5 sequent
the shOre remEmbers nOthing thAt it hEld              5 sequent
nor cAres what tOil was wrItten In its wAves          5 sequent
yet whIle the vErse is Young the wOrd goes thrOugh    5 sequent
so lEt the rEader spEak intO the glAss                5 sequent
and hEar the sOnnet Answer whIle it lAsts             5 sequent

Note that the last ten lines are also the program's documentation, which is the only kind of documentation the language permits.

Open problems

  • No Hello, world! program is known. Printing a byte requires either 72 or more increments inside a defence loop (which needs a counter, and the language has one jump target) or an orbit of the Shore that happens to sweep the right instructions past the Wave in the right order. Both are believed possible; neither has been exhibited.
  • Is Threescore Turing-complete? The Sea is unbounded and the Shore is a finite-state control that repeats with period dividing 16380, so the machine is a finite-state control over an unbounded tape with a very awkward branch. The author suspects it is complete and has not proved it.
  • Which of the 2140 Shores are reachable as English verse is an unstudied and probably unstudiable question. 1111111111 asks for ten stressed syllables in a row, which is legal but not pleasant.

Interpreter

A reference interpreter in Python is available: threescore.py. It supports --scan (print the scansion and the opcode of each line), --trace, and --shore (print the Shore after every ageing).

$ echo "Nothing gainst Time's scythe" | python3 threescore.py echo.60
Nothing gainst Time's scythe
$ python3 threescore.py sonnet60.60 --shore
--- shore after 0 passes ---
  .#.#.#.#.#   5 sequent      (× 14)
--- shore after 1 pass ---
  ##########  10 mow          (× 14)
--- shore after 2 passes ---
  ..........   0 nothing      (× 14)