Mezzo
Each line's result becomes the new meaning of its line number. Once line 0 has run, 0 is no longer zero.
Stegoratops, 2026 · Turing complete: unknown · ●●○ moderate · esolangs.org
Tested with 5 known programs · Test method
Run it
The idea
Stegoratops made Mezzo in 2026, after Forte and Hofstadter. A program is one expression per line, run from the top. When line 3 has run, the number 3 written anywhere in the program means line 3's result. In Forte such a change reaches into every number; in Mezzo it goes one level deep, so the numbers act as odd variable names.
Read the story
There are no jumps. The program runs to its end and starts again at the top, and the only way out is an invalid operation such as a division by zero. Programs end on a line like 0/(0-0), as 0-0 is 0 whatever 0 has come to mean.
The machine
| Part | Means |
|---|---|
1234 01234 0x1234 | A number in decimal, octal or hexadecimal, or the result of that line |
'Hi' | Text as one number, its first byte lowest, never a line |
+ - * / % | Arithmetic on whole numbers |
- abs sign | Negation, absolute value, sign |
in n nin n | The n-th byte or the n-th number of the input, from 0 |
$ before a line | Prints the result as bytes, lowest first |
# before a line | Prints the result in decimal |
Lines count from 0. Past the end of the input in and nin give -1, and $ prints nothing for a number below 1.
Example
The Hello World.
The Hello World. After the first line, 0 means 'Hello ', the number 35662932501832, so the last line cannot divide by a plain 0 and divides by 0-0 instead.
The truth machine. Line 1 prints a line feed times 4-3-0, which is 1 when the input was 0 and 0 otherwise. Line 2 divides 0 by itself. That ends the run on 0 and gives 1 on 1, so a 1 prints forever.
The cat. Line 0 counts up through the input, line 2 prints the byte at that place, and line 3 divides 1 by the byte plus 1. At the end of the input the byte is -1 and the division ends the run.
The calculator reads an operator and two numbers. Lines 4 to 7 are 1 for the operator given and 0 for the others, and line 12 adds the four results, each times its flag. Line 7 is 0 for a division by 0, and then the division in line 12 is by -1 instead.
Patterns it teaches
- Encoding tricks: text is a number, and a number is a line's name.
Further
See also
Also in Strange time
Write your own in Run Convert a program from Mezzo
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: mezzo.
Command line
shib run mezzo -e '0+1
1
$in(0-1)
1/(2+1)' --input 'abc'shib manual mezzoSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/mezzo.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org