Exoshell

Exoshell is a minimal loop-based esolanguage designed by Keymaker. A version of the language was designed in 2020 and left on the back burner, as it was not quite right yet; eventually the language was redesigned and published in 2025, once the author had some new ideas.

Language description

The program consists of a non-negative number of loops formed with characters [ and ]. All other characters are ignored. Parentheses can be nested, and must be matching. The memory is a binary queue, initially always 1100. If the instruction pointer (initially at the first instruction) moves past the last instruction, the program halts (successfully). Trying to read / remove from empty queue is undefined behaviour (which cannot happen in a valid program). The two parenthesis characters, [ and ], can be considered instructions of their own, even though each parenthesis needs its matching pair. The two instructions are as such:

[ If first in queue is 0: remove first in queue, skip loop (move right after matching ] parenthesis). If first in queue is 1: remove first in queue, enter loop (move to next instruction).

] If first in queue is 0: exit loop (move to next instruction). If first in queue is 1: see next two bits (if queue has less than three bits in total, this causes undefined behaviour); if 1 is followed by 00 or 01, append 111011001101100 (for 00) or 0111011001101100 (for 01), in other cases append nothing; then (in any case) go to matching [.

Example program

This is a simple program that grows limitlessly and never halts. On each cycle of the main loop the program adds two new 0-strings (111011001101100).

; initial memory is always 1100
1100
[] ; append '0'
  00111011001101100
[][] ; remove two 0s
    111011001101100

; main loop. entering the loop removes the first 1.
[ ; inside the loop, always at the beginning of a 0-string from which one 1 has been removed when entering the loop.
  11011001101100
  [[]] ; remove 11
    011001101100
  [] ; remove 0
     11001101100
  [] ; append '0'
       001101100111011001101100
  [] [] [[]] [] ; remove 00110
            1100111011001101100
  [] ; append '0'
              00111011001101100111011001101100
  [][] ; remove 00
                111011001101100111011001101100
  ; now at the beginning of a 0-string. go to matching loop start, where the first 1 is removed and this loop entered again.
]

On design

It was one of my long-time esolanguage design goals to create a language that is based on loops and has no other instructions than the parentheses, and no other symbols than the two parenthesis symbols used to form the loops. An earlier language of mine, Etre, got close with parentheses + one instruction. Close, but not quite there yet! While there are some loop-based esolangs out there that use just loops, all of them (as far as I know), at least the Turing-complete ones — at the moment of writing this — encode special functionality with the parentheses. For instance, the number of nested parentheses may cause different actions, or groups of parentheses may be read as patterns that do one thing or another. In Exoshell there is none of that; there are only the two instructions, and nothing additional is encoded with the structure of the program.

Of course, to have a Turing-complete design, I needed to carefully design the two different bit-strings that are appended (and had to ascertain a viable mechanism for appending them, of course). They might not be the absolute shortest ones; they were chosen to be something that worked with the language design (which was simultaneously calibrated to work with the bit-strings). I did not strive for the most minimal design, but for a degree of usability. The bit-strings were designed to be kind of representatives for '0' and '1'; something that could be used in binary fashion. An interesting property of the strings in this language is that they need to be able to potentially generate two new bit-strings (otherwise the memory cannot expand). Thus, the design allows both types of strings to potentially generate two instances of either string type.

Computational class

When I was planning the proof of Turing-completeness, I wanted to make something that would be relatively simple to implement and debug, as the process never goes error-free. And since Exoshell's memory is just a long string of 0s and 1s and its programs nests of parentheses, debugging is not easy. I wanted to make a translation that would generate relatively simple Exoshell code. Cyclic Tag presented a problem with its arbitrarily-sized production rules, Minsky Machine with its arbitrary state control. Sure, neither problem is impossible, but as mentioned, I wanted somewhat understandable Exoshell output. At some point I got an idea for an intermediate language that bridges a translation from Minsky Machine into Exoshell. I realized the counter-based language was actually quite useful, so I shaped it into a proper esolanguage of its own: Countertrue.

Countertrue has a fixed set of counters and no arbitrary control flow; each step is executed in sequence and then the cycle begins again. A step may either increase or decrease (or do neither) any counter, including itself. But a counter's operations may not perform both increasing and decreasing to a counter, nor can an individual counter be increased or decreased more than once per counter. Countertrue was designed with Exoshell's limitations in mind.

As I got better acquaintanced with Exoshell, I realized that translating the atomized 'Cyclic Tag language' might have been much easier, but at that point I had already designed Countertrue, and wanted to complete the translation project using it. Besides, I prefer a Minsky Machine translation, as it is often easier to decipher the execution of the program from the memory states of the target language.

Interpreter and translator

exoshell.py - An interpreter written in Python. Additional parameters: -mem 0101abb0, a very useful parameter for testing code, sets the initial memory to given memory string. 0 and 1 are for the digits 0 and 1, a and b place the 0-string and 1-string. -halttime 100 halts the program on given step, unless the program halts on its own before reaching it. -noout tells the interpreter not to output the state of the memory after every step. Useful in combination with -halttime.

ctoexo.py - A Countertrue to Exoshell translator. An additional argument after the input file, such as "abc", will print the translation without any comments, just a wall of parenthesis.

-- Keymaker, 1st December 2025