Why You Should Try Brainfuck
>+++++++++[<++++++++>-] <. ---. +++++++.. +++.
Background
I first came across Brainfuck last year by one of Nicuevo's streams solving AOC 2024 day 7, wrote my first program and left it, until recently I got back and it felt like meeting your long lost brother (at least for a while). The whole purpose of writing this blog is to share that joy with anyone who reads this. It also serves as a reminder if you have already explored Brainfuck previously and left it on the way to make a debut back or an invitation for someone who hasn't heard of it before to get their hands muddy.
Why
A bit of context first: Brainfuck is a low level esoteric Turing complete language built by Urban Mueller in 1993 while he was doing his undergrad in physics. What does it look like?
++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
Now the question is why? The real reason as quoted by Mueller was to
implement a compiler—yes not the ones that you make as part of the C
courses, (it was eventually 170 bytes in total), but for me the real
reason is still TO HAVE FUN. Where is the fun in
writing useState
or import torch
? We often
don't think and just blurt out the syntax with your keyboard, but
Brainfuck makes you think—activate more neurons than usual.
The next time you're a bit bored: write hello world in Brainfuck, treat it as a brainteaser and try to effectively figure out 4 different ways of doing the same thing. I won't give a tutorial on how to do that here (there are many already) but instead convince you in 4 points to do the same.
- It's fun - it's not about building something life impacting or useful (most of the times)
- Use your brain - when you write something in a specific way and go to bed, you're bound to think about the other n ways to do the same thing more efficiently. Over time I felt I did these while writing the first attempt.
- Low level - take some break from your high level friend, go low level—back to the memory, it's like a programming detox
- Learn how to code - write good and structured code, something that is declining and would help in high level languages too
A few helpful links are dropped below and if you still aren't convinced probably you are doing all of this for the wrong reasons.
+[----->+++<]>.++++++++..-----------.-[--->+<]>-.++[--->++<]>.+++++++++.+[->+++<]>+.++++++++.