DOESNT
Rules that say what they will not take, eating a ring of symbols from the head.
&0, 2026 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
&0 created DOESNT at the very start of 2026, after the prompt for Language 18 in the book Forty-Four Esolangs. It rewrites one string of symbols, kept in a ring. A rule does not say what it matches. It says what it gives, and then lists the prefixes it leaves alone. Whether DOESNT is Turing complete has not been proven, and it has no input or output; what it shows is a trace of every rewrite.
The machine
A program has rules, give x unless p , q !! , ... ;, and a start, have s ;. Symbols are words split by whitespace.
At the head of the ring each rule is tried in turn. A rule takes symbols one by one until what it took is one of its prefixes. Then it gives the last symbol back and puts its own symbols in place of the rest. A prefix marked !! makes the rule fail at once instead. A rule that would take nothing does not fire. When no rule fires, the head moves on one symbol, and once it has gone round the whole ring the program halts.
The three traces settle two things. A match ends where the row of symbols ends and does not wrap round, and the row is printed from the same start each time, with new symbols where the taken ones were.
Example
The first program.
The first program. At a and b the rule stops before it takes anything; at c it takes c d e and gives taken.
With !! the first rule fails on a b, so the second can take it.
The addition, 4 + 3. The first rule walks the + to the right and turns each b it passes into an a; the second drops the + when it reaches the end.
The poem starts from what is DOESNT? and each of its five rules writes one line of it. Its bouncing cursor <& walks left over the stars to @, turns into &> and walks back, for ever.
Patterns it teaches
- String rewriting: with rules that name only their exceptions.
Further
See also
String-rewriting paradigm
Write your own in Run Convert a program from DOESNT
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: doesnt.
Command line
shib run doesnt -e 'give taken unless a , b , taken ;
have a b c d e ;'shib manual doesntSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/doesnt.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org