💾 Archived View for goodclover.xyz › notes › computers › artificial › brainfuck.gmi captured on 2022-04-28 at 18:05:25. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2022-01-08)

-=-=-=-=-=-=-

Brainfuck

Brainfuck is a computer with an infinite tape for memory.

It runs a tiny instruction set with eight commads.

Theoretically Turing complete.

Note 'computer' here is used as the lowest form it would make sense to understand at.

It is most commonly used as an interpreted language.

Instructions

Tape memory

Brainfuck's memory is desribed as a 'tape', an infinite sequence of cells.

There are many variants of this tape.

Input and output

Input will block if there is no buffered data.

Upon reaching the EOF there are variations:

Common virtual machine quirks

It is common for a virtual machine to buffer input, only sending it upon receiving a newline.

Newlines are often normalised to a line-feed (LF, '\n') upon input.

Textual format

Brainfuck code files use a file extension of `bf`.

Commands are represented by their symbols, any other characters are ignored.

'!' is sometimes used to seperate code (left) from pre-buffered input (right).

'#' is sometimes used to print debug info on the current state of the computer.

Extensions

There are many, many extensions to brainfuck.

A table of extensions.

Often these raise it to a programming language, not a computer.

Beware the 'equivalents', where people have only replaced the symbols, without modification.

Elsewhere

https://esolangs.org/wiki/brainfuck