esolang

Brainf*ck

It looks like brainfuck and is named like brainfuck with a star, and it is something else entirely.

None1, 2024 · Turing complete: no · ●●○ moderate · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: 3

The idea

None1 made Brainf*ck in 2024 to be the language people mean when they censor the name. The programs are made of the same eight characters, but they mean different things. There is no tape. There is one stack, and every command returns a value. >[ and ]< are not moves and a loop, they are the brackets of a sum, so >[+++]< pushes 3.

Read the story

A loop can hold sums but cannot nest inside another loop's value, so the stack is the only memory that grows. That makes it a pushdown automaton.

The machine

CodeReturns
+1
-The top of the stack, popped
,A byte of input
.Prints the top, returns 0
>[ ... ]<Pushes the sum of what the inside returned, and returns it
[ ... ]Runs the inside while the top is not 0, returns 0

Bytes wrap at 256. The specification does not say what . returns or what , gives at the end of input; this implementation makes both 0.

Example

The A+B problem reads 1, a space and 2, adds 176 to their codes so that the sum wraps to the code of 3,…

The A+B problem reads 1, a space and 2, adds 176 to their codes so that the sum wraps to the code of 3, and prints it.

Expected: He

The truth machine pushes the input, prints it, and subtracts 48 by adding 208. On 0 that leaves 0 and the loop never starts.

Further

Ideas it shows

Brainf*ck builds on Brainfuck.

Brainfuck derivatives

Stack-based

Write your own in Run Convert a program from Brainf*ck

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: brainf-ck.

Command line

shib run brainf-ck -e '>[,,,++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++]<>[.]<' --input '1 2'
shib manual brainf-ck

Source

Module
langs/wiki/ports.js
Interpreter
langs/wiki/brainf-ck.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org