Or+3
A stack of true and false, with falses all the way down, and a byte written one bit at a time.
2026 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Or+3 is a superset of Or++, and so of or, a language whose only command pushes false. It has 11 one-letter commands on one stack of booleans. The stack never runs dry, as there are endless falses under whatever was pushed. Input and output go one bit at a time, eight bits to a byte, low bit first.
Read the story
The specification says it is Turing complete by a short reduction to bitwise cyclic tag. The command r turns the whole stack over, so the bottom can be read too and the stack can serve as a queue.
The machine
| Command | Does |
|---|---|
f t | Push false, push true |
p | Pop the top |
r | Reverse the stack |
n | Negate the top |
h | Halt if nothing pushed is left |
j | Jump to the first command |
s | Skip the next command |
c | Skip the next command if the top is true, without popping |
i | Read a bit and push it |
o | Pop a bit and write it |
Every other character is ignored. i at the end of the input ends the run.
Example
The Hello, World! pushes one bit and writes it straight away, 104 times.
The Hello, World! pushes one bit and writes it straight away, 104 times.
The cat copies one bit per pass.
The specification also copies a Collatz sequence from Or++. It never writes, and with these rules it pushes 18 bits and takes 7 away on every pass, so it never stops.
Patterns it teaches
- Turing tarpit: booleans, a reverse and a jump back to the start.
- Stack machines: one stack, read from both ends by turning it over.
Further
See also
Stack-based
Write your own in Run Convert a program from Or+3
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: or-3.
Command line
shib run or-3 -e 'ioj' --input 'cat'shib manual or-3Source
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/or-3.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org