Glossary
Each term in a sentence or two, with a link to the page that explains it.
The machine
- ASCII
- The table that gives each letter, digit and sign a number from 0 to 127: A is 65, a is 97, the digit 0 is 48, a space is 32. Brainfuck prints and reads characters as these numbers. Output and input.
- Byte
- A number from 0 to 255: eight bits. The usual size of a cell.
- Cell
- One place on the tape. It holds one whole number and starts at 0. The machine.
- Command
- One of the eight things brainfuck understands, each written as one character:
+ - < > [ ] . ,. Other texts call it an instruction. The eight commands. - End of input (EOF)
- The moment a program asks for a character and there is none left. Implementations then store 0, store −1, or leave the cell as it is. The end of the input.
- Loop
- The part of a program between a
[and its matching]. It repeats while the cell under the pointer is not 0. Loops. - New line
- The character that ends a line. In brainfuck programs it is the number 10. New lines.
- Pointer
- The mark that says which cell is the current one. Also called the data pointer or the head. The machine.
- Tape
- The memory of a brainfuck program: one row of cells. Also called the array, as in the original README. 30,000 cells in the original. The length of the tape.
- Wrapping
- What most implementations do when a cell passes its largest or smallest value: it goes round. With 8-bit cells, 255 plus one is 0 and 0 minus one is 255. Cell size and wrapping.
Programs
- Balanced loop
- A loop whose body brings the pointer back to the cell where it started. Only balanced loops can be turned into a single multiplication. Writing for speed.
- Clear loop
- The loop [-], which makes a cell 0. The idioms.
- Comment
- Any character in a program that is not one of the eight commands. It is ignored. What a program is.
- Comment loop
- A loop at the very start of a program. The first cell is 0, so the loop never runs, and text inside it is safe even if it contains command characters. What a program is.
- Copy loop
- A loop such as [->+>+<<] that adds a cell to others while emptying it. With a second loop that moves one copy back, the original is kept. The idioms.
- Idiom
- A short piece of program that does one common job and is used again and again. Also called a pattern. Code patterns.
- Layout (memory map)
- The plan of which cell holds what. Made before the program is written. Think in cells.
- Multiply loop
- A loop such as [->+++<] that adds a multiple of one cell to another. Recognise simple loops.
- Program
- A text of commands. The machine reads it from left to right, one command at a time. On this site the chat models are programs of billions of commands. What a program is.
- Quine
- A program that prints its own text. Quines.
- Scan loop
- The loop [>] or [<], which moves the pointer to the next cell that holds 0. Recognise simple loops.
- Self-interpreter
- An interpreter for a language, written in that language. Brainfuck in brainfuck.
- Spare cell (temp)
- A cell that an idiom uses for a moment and leaves at 0. The idioms.
Implementations
- Compiler
- A program that translates a program into another form, once, before it runs: into C, machine code or WebAssembly. Compiling.
- Contraction (run-length merging)
- Treating a row of the same command as one operation: +++++ becomes "add 5". Merge runs.
- Implementation
- Any program or machine that carries out brainfuck programs: an interpreter, a compiler, or hardware.
- Interpreter
- Software that reads a program and carries it out. On this site your browser does it. One command at a time.
- JIT (just-in-time compiler)
- A compiler that makes machine code while the program is already running, and then runs that. Compiling.
- Offset folding
- Working on cells at a distance from the pointer without moving it, and moving once at the end. Fold the moves away.
- Optimising
- Making an implementation faster without changing any result.
- Portable
- Said of a program that behaves the same on every implementation. Programs that work everywhere.
- Step
- One unit of work of an implementation. One command at a time, a step is a command. In an optimising implementation one step can stand for a whole loop, so step counts differ between implementations.
- WebAssembly
- The machine code of web browsers. The chat pages of this site translate brainfuck into it.
The chat models
- Attention
- The part of a layer where the model looks back at the earlier word pieces and decides which ones matter for the next one. How it works.
- Engine
- The short last stretch of the program that reads your question, does the arithmetic with the weights, and prints the answer. Inside the program.
- Layer
- One round of the model's arithmetic. An answer passes through 24 to 30 layers, one after the other. How it works.
- Model
- The part that learned to answer: a very long list of numbers (its weights) and a fixed recipe for multiplying and adding them. The program is its brainfuck form. Four chat models.
- Weight
- One of the numbers the model learned in training. The model multiplies it with other numbers to work out its answer. How it works.
- Word piece
- A word or part of a word, like "capital" or "ing", which the model reads and writes instead of single letters. Other sites call it a token. How it works.
- Writing part
- The first, enormous stretch of the program. It only puts the model's weights onto the tape, and neither reads nor prints. Inside the program.
The wider world
- Aminet
- The archive of software for the Amiga computer where brainfuck was first published. Founded by the language's author. History.
- Code golf
- The sport of writing a program for a task in as few characters as possible. Code golf.
- Derivative
- A language made by changing brainfuck. Relatives and derivatives.
- Esoteric language (esolang)
- A programming language made to try an idea, to make a point or for fun, not for everyday work. Ancestors.
- FALSE
- The language of 1993 whose 1,024-byte compiler moved Müller to make brainfuck.
- P′′
- Corrado Böhm's language of 1964, which brainfuck closely resembles. Say "P double prime". Ancestors.
- Polyglot
- One text that is a valid program in several languages at once. Brainfuck is easy to include, because it ignores every character it does not know.
- Trivial substitution
- A language that is brainfuck with the eight commands renamed, such as Ook!. The same language in other words.
- Turing complete
- Able to compute everything that any computer can compute, given enough memory and time. Theory.
- Turing machine
- Alan Turing's imaginary machine of 1936: a tape, a head, a table of rules. The measure of what "computable" means.
- Turing tarpit
- A language that can do everything in principle and makes everything hard in practice. After a remark by Alan Perlis. The Turing tarpit.