___ _ __ _
/ __\ _ __ __(_)_ __ / _|_ _ ___| | __
/__\/// '_/ _` | | '_ \| |_| || |/ __| |/ /
/ \/ \| | | (_| | | | | | _| || | (__| <
\_____/|_| \__,_|_|_| |_|_| \_,_|\___|_|\_\
Brainfuck is a brilliant language to melt your brain. Read the description on Brian Raiter’s page
While other languages hide behind layers of abstraction, syntactic sugar, and “helpful” features, Brainfuck stands as the ultimate expression of computational truth. Here’s why:
> increment the data pointer
< decrement the data pointer
+ increment the byte at the data pointer
- decrement the byte at the data pointer
. output the byte at the data pointer
, input a byte and store it at the data pointer
[ jump forward to the command after the matching ] if the byte at the data pointer is zero
] jump back to the command after the matching [ if the byte at the data pointer is nonzero
No keywords to memorize. No frameworks to install. No dependency hell. Just pure, unadulterated computing.
Other languages lie to you with their “convenience”:
Python:
print("Hello World!")
Hides everything from you. What’s really happening? You’ll never know.
JavaScript:
console.log("Hello World!");
Console? Log? Abstractions upon abstractions!
The Brainfuck Truth:
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Every. Single. Operation. Explicit. Beautiful. Honest.
While lesser languages use modulo operators and if-statements like crutches, Brainfuck forces you to truly understand the algorithm:
++++++++++[>++++++++++<-]>>++++++++++>->>>>>>>>>>>>>>>>-->+++++++[->++
++++++++<]>[->+>+>+>+<<<<]+++>>+++>>>++++++++[-<++++<++++<++++>>>]++++
+[-<++++<++++>>]>>-->++++++[->+++++++++++<]>[->+>+>+>+<<<<]+++++>>+>++
++++>++++++>++++++++[-<++++<++++<++++>>>]++++++[-<+++<+++<+++>>>]>>-->
---+[-<+]-<[+[->+]-<<->>>+>[-]++[-->++]-->+++[---++[--<++]---->>-<+>[+
+++[----<++++]--[>]++[-->++]--<]>++[--+[-<+]->>[-]+++++[---->++++]-->[
->+<]>>[.>]++[-->++]]-->+++]---+[-<+]->>-[+>>>+[-<+]->>>++++++++++<<[-
>+>-[>+>>]>[+[-<+>]>+>>]<<<<<<]>>[-]>>>++++++++++<[->-[>+>>]>[+[-<+>]>
+>>]<<<<<]>[-]>>[>++++++[-<++++++++>]<.<<+>+>[-]]<[<[->-<]++++++[->+++
+++++<]>.[-]]<<++++++[-<++++++++>]<.[-]<<[-<+>]+[-<+]->>]+[-]<<<.>>>+[
-<+]-<<]
FizzBuzz in Brainfuck? That’s for true masters.
Adding two single-digit numbers:
, Read first number
> Move to second cell
, Read second number
[<+>-] Transfer second to first (add them)
<. Output result
No + operator hiding the computational complexity. You build addition from scratch!
><+-.,[]Think you can solve Advent of Code 2024 in Brainfuck? That’s the ultimate test of programming prowess. While others use their “high-level” languages, you’ll be operating at the level of pure computational truth.
“Any fool can write code in Python. It takes a true engineer to write it in Brainfuck.” - Ancient Programming Proverb (probably)