esolang

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

Expected: 0

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

WordDoes
inpRead a number into the cell
outPrint the cell and a line feed
left rightMove the pointer
flipTurn 0 into 1 and 1 into 0
loop ... endRepeat 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.

Expected: 1

Patterns it teaches

  • Turing tarpit: seven words on bits, with one loop for both repetition and choice.

Further

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 sembly

Source

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