Miserie is a minimal state + queue esolang specifically designed to be translated into DownRight. The language was designed by Keymaker in 2019 but not published until the DownRight translation was achieved in 2025. The language was named after the translation was complete.
Miserie has a binary queue, which is initialized at the start of the program, before the program instructions. The initial queue may be presented with more than one binary string, all of which are concatenated into one string. Each begins with -
followed by an arbitrary string of 0
and 1
. If no data is defined (the program can be without initial memory definitions) the queue will be empty and the first instruction halts the program.
There is just one type of instruction:
state(0-data,0-state)(1-data,1-state)
An instruction begins by removing the first bit from the queue and inspecting it, or immediately halting if the queue is empty. If the bit is 0, the program uses data from the first parentheses. If 1, from the second. Both parentheses contain the data that is appended to the queue, and the label of the instruction where the program focus (or, state) is transferred next.
Each instruction is labelled by its unique state, a non-empty string consisting of characters [a-z] and [0-9] in any order. The state is followed by parentheses inside which there are two strings, separated by ,
. The first string is 0-data, which is the data that is appended to the queue in case the bit in queue was 0. If the data is empty (and nothing is added to the queue, in other words), use -
. If there is no next state, the program halts. The non-existence of a state is marked with *
(all states in use must be defined states somewhere in the program). The next parentheses are the same, except for the case the bit was 1, thus defining the 1-data and the next state for it.
The program must have at least one instruction. The program execution begins at the first defined instruction. Comments begin with ;
and continue till the end of the line. An otherwise empty line may have spaces, and spaces are allowed before and after instruction, and around initial data as well.
Here is a small example program:
-11 -01 ; the initial queue will be 1101 a(00,*)(010,a) ; this will append 010 if bit is 1, and append 00 and halt if bit is 0 ; the final queue will be 101001000
The language is Turing-complete. A simple way to prove this is by translating Cyclic Tag into it.
Take the initial queue of the Cyclic Tag program and place "-" before it. Place this as the first line. Go through production rules and add an unique label for each (for instance an increasing number starting from 0). For every production rule create "n(-,m)(q,m)" where n is the label for current production rule, m is the label of the next production rule (or the label of the first production rule, in case of the last production rule), and q is the data the production rule appends (if the data is empty, use "-" instead).
An example: 110; 0; ; 100;
with initial queue 111
would produce the Miserie program:
-111 0(-,1)(110,1) 1(-,2)(0,2) 2(-,3)(-,3) 3(-,0)(100,0)
Although no more proof is needed, I did make an I/D machine to Miserie translator because I wanted to try implementing a boundless random-access array with unbounded cells within a binary queue. See the software section.
I designed Miserie to be a simple language with state and queue, my eye on its DownRight-translatability. Needless to say, I had some fundamental errors in my thinking, and the task was anything but simple, and the end result very different from what I initially imagined it would be.
As the translation is rather complex, I decided to write it in some detail on the Esowiki instead. Find it via the Miserie article. Software relevant to the translation can be found linked there.
For an example, this program
-110 a(-,*)(0,a)
translated into DownRight with mcompiler and generated into a visual DownRight interpreter (via drintgen) can be found here.
miserie.py - An interpreter written in Python. The source may have debug instructions embedded in comments. The word 'debug' followed by state names used in the program, separated by spaces. For example: ; debug inst1 inst3
, which would cause the interpreter to display the state name and the memory (before it is modified by the instruction) whenever the current state is found in the list of given debug states. The debug states may be given in more than one comment, but each must begin with 'debug'. If there are no debug states, the interpreter will just display the current memory as it is at the beginning of each state.
idtomiserie.py - I/D machine to Miserie translator. Edit the program to change the input program. Writes a 'debug' comment for the states at the beginning of each simulated instruction.
mcompiler.py - Miserie to DownRight compiler/translator. Outputs in the simplified DownRight format used by my DownRight tools.
-- Keymaker, 19.9.2025