What Is Brainfuck? The Minimalist Esoteric Programming Language
Brainfuck is an esoteric programming language created in 1993 by Urban Müller. Designed as an experiment in minimal compiler size, the language uses only eight commands yet remains Turing complete. Brainfuck is widely known among programmers as a challenging and unusual language used for experimentation, education, and programming puzzles.
Brainfuck: The Programming Language That Shouldn’t Exist (But Does)
Most programming languages are designed to make development easier and code more readable. Languages like Python, JavaScript, and C provide structures, functions, and clear syntax to help developers build complex software.
Then there is Brainfuck — a programming language that takes the exact opposite approach.
Brainfuck is famous for being extremely minimal, extremely confusing, and surprisingly powerful. Despite its strange design, it is still a fully capable programming language.
This article explains what Brainfuck is, who created it, why it exists, and how you can run it on your computer.
What is Brainfuck?
Brainfuck is an esoteric programming language, often called an esolang.
Esoteric languages are typically created for experimentation, entertainment, or to challenge programmers rather than for practical software development.
Brainfuck is famous because it uses only eight commands:
> < + - . , [ ]
That is the entire language.
There are no keywords, no functions, no variables, and no typical syntax that programmers are used to. Programs written in Brainfuck often look like random symbols.
Despite this minimal design, Brainfuck is Turing complete, meaning it can theoretically perform any computation that other programming languages can.
File Format and Comments
Brainfuck programs are typically saved using the .bf file extension.
Example:
hello.bf
Another unusual feature of Brainfuck is how it handles comments.
The interpreter ignores any characters that are not part of the eight commands:
> < + - . , [ ]
This means you can write comments using normal text.
Example:
This program prints Hello World
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.
Everything except the Brainfuck commands is ignored by the interpreter.
Who Created Brainfuck?
Brainfuck was created in 1993 by Urban Müller, a Swiss student.
His goal was to design a programming language with the smallest possible compiler.
The original Brainfuck compiler was only 296 bytes in size, which is extremely small even by today's standards. For comparison, most modern programs require thousands or millions of bytes just to start.
Brainfuck was created as a demonstration of how minimal a programming language can be while still remaining computationally complete.
The official website for the language is:
http://brainfuck.org
Why Was Brainfuck Created?
Brainfuck was not designed for practical use. Instead, it was created to explore extreme minimalism in programming language design.
The main ideas behind Brainfuck include:
- Demonstrating that a language can be powerful with very few commands
- Challenging programmers to think differently about computation
- Experimenting with compiler size and efficiency
- Creating a language that is intentionally difficult to read and write
Writing Brainfuck programs often feels more like solving a puzzle than writing traditional code.
Brainfuck Commands
Brainfuck operates on a tape of memory cells, usually containing around 30,000 cells.
Each cell stores a value, and a pointer moves across these cells to manipulate data.
The language has only eight commands:
| Command | Description |
|---|---|
> |
Move the memory pointer to the right |
< |
Move the memory pointer to the left |
+ |
Increase the value of the current cell |
- |
Decrease the value of the current cell |
. |
Output the character stored in the current cell |
, |
Accept input from the user |
[ |
Start a loop |
] |
End a loop |
These commands allow Brainfuck to manipulate memory and perform computations.
How to Run Brainfuck on Your Computer
There are multiple ways to execute Brainfuck programs depending on how much effort you want to put into it.
Option 1: The Historical Purist Setup
If you truly want the authentic 1990s experience, follow these steps carefully:
- First uninstall your current operating system.
- Calmly explain to your computer why this is necessary.
- Install Amiga OS.
- Locate a Brainfuck interpreter designed for Amiga systems.
- Write your Brainfuck code and execute it.
At this point you may notice two things:
- Your computer setup has become dramatically more complicated.
- You did all this just to run a language that uses eight characters.
This method is mentioned mainly for historical humor. Deleting your operating system is not required to run Brainfuck, and doing so will likely create more problems than programming satisfaction.
Learn More about Amiga OS
Option 2: Using an Online Compiler
The easiest and most practical approach is to use an online compiler.
You can try this one:
https://www.tutorialspoint.com/compilers/online-brainfk-compiler.htm
Steps:
- Open the website
- Paste your Brainfuck code
- Click Run
- The output will appear instantly
No installation or configuration is required.
Option 3: Running Brainfuck Using Python
You can also execute Brainfuck programs locally using Python.
Install the brainfk package:
pip install brainfk
Then run Brainfuck code from Python.
Example:
import brainfk
code = "++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++."
brainfk.run(code)
Save the file and execute it:
python program.py
The Brainfuck code will run and produce the output.
Example Brainfuck Program
Here is a simple Brainfuck program that prints Hello World:
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.
Even very small outputs require long sequences of commands because of the language’s minimal design.
Final Thoughts
Brainfuck is not intended for building practical software, but it has become one of the most famous esoteric programming languages.
It demonstrates how little syntax a programming language actually needs to perform computation. At the same time, it highlights how important readability and structure are in real-world programming.
Although writing programs in Brainfuck can be difficult and confusing, it remains an interesting example of minimalistic language design and continues to be studied and experimented with by programmers around the world.