esolang

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

Expected: Hello, World!

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

CommandDoes
f tPush false, push true
pPop the top
rReverse the stack
nNegate the top
hHalt if nothing pushed is left
jJump to the first command
sSkip the next command
cSkip the next command if the top is true, without popping
iRead a bit and push it
oPop 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.

Expected: cat

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

Further

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-3

Source

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