Sembly
Brainfuck on single bits, spelled out one word to a line, with the loop turned inside out.
2025 · Turing complete: yes · ●○○ easy · esolangs.org
Tested with 9 known programs · Test method
Run it
The idea
Sembly is a cell-based language from 2025. Its cells hold one bit each and it has seven words, each without arguments. The specification calls it Boolfuck with an inverted loop condition. A loop goes in when the cell is 0 and keeps going until the cell is 1, which is the other way round from brainfuck.
Read the story
The same loop serves as the language's only if. The gates use it that way, entering a block once and flipping the cell so it does not come back.
The machine
| Word | Does |
|---|---|
inp | Read a number into the cell |
out | Print the cell and a line feed |
left right | Move the pointer |
flip | Turn 0 into 1 and 1 into 0 |
loop ... end | Repeat while the cell is 0 |
Each word goes on its own line, and each inp reads one line of input. The Python interpreter looks for the words anywhere in a line, so a line that says output runs out.
Example
The truth machine.
The truth machine. On 0 it prints 0 once. On 1 the loop is entered and prints 1 forever.
The NOR gate from the specification reads two bits, one per line. It prints 1 only when both are 0.
Patterns it teaches
- Turing tarpit: seven words on bits, with one loop for both repetition and choice.
Further
See also
Sembly builds on Brainfuck.
Brainfuck derivatives
Cell-based
Write your own in Run Convert a program from Sembly
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: sembly.
Command line
shib run sembly -e 'inp
out
flip
loop
flip
out
flip
end' --input '0'shib manual semblySource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/sembly.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org