ZME Science
No Result
View All Result
ZME Science
No Result
View All Result
ZME Science

Home → Features → Technology → Computer Science & IT

Meet the most frustrating programming language ever. It’s called ‘Brainfuck’ and it’s purposely designed to make you cry

Continue at your own risk.

Tibi PuiubyTibi Puiu
January 26, 2017 - Updated on May 1, 2023
in Computer Science & IT, Science
A A
Share on FacebookShare on TwitterSubmit to Reddit
brainfuck programming.
Credit: Quora.

If you earn your bread as a web developer, then you know how frustrating it can be to keep up with all the new libraries and frameworks. If you use jquery and PHP you’re a pleb. HTML? You must be mad. Everyone knows a good developer in 2017 uses Babel, React, ES5, ECMAScript, Browserfy, Webpack and…. 

Seriously, unless you’re a masochist, there’s no reason why you should dive straight for all the ‘developing trends of 2017’. Stick to core tools and add new ones when you need them and you should be just fine. Coding — writing instructions for a machine — should be made easier, not more confusing. Speaking of which, it seems like Urban Müller missed the memo.

Müller is an underground culture sensation among computer programmers. In 1993, at the time a physics student in Switzerland, the young computer programmer set out to make the smallest possible compiler. The compiler is what translates code written in a programming language into something your CPU can understand, i.e. binary code. The smaller the compiler, the less time and energy it takes for the machine to respond.

In the end, Müller came up with ‘Brainfuck’, a new programming language whose compiler uses only 240 bytes of memory making it around 11,000 times smaller than the C++ compiler. However, by making such a smaller compiler,  Müller had to sacrifice practicality. In Brainfuck, you can only use eight commands:  <, >, +, –, [, ], and ,. That’s it. Can you imagine writing code just with that? This programming language sticks to its name, that’s for sure, despite being Turing-complete. That was the entire point, in fact — make an esoteric new programming language whose role is not to be of any particular use. It’s simply an amusing challenge.

Let’s take a look at some Brainfuck code. One of the first things a newbie programmer learns to do is display or echo a string of text. Usually, the string ‘Hello, world!’ is used to illustrate basic syntax. To output this text, in Java you have to write:

public class HelloWorld {

public static void main(String[] args) {
System.out.println("Hello, World");
}

}

In Python, it’s this simple:

print “Hello, World!”

In Brainfuck, it’s:

RelatedPosts

Microsoft AI boasts 97% accuracy in detecting software bugs
AI can write new code by borrowing lines from other programs
Obama gets his hands dirty with computer programming
Language skill may matter more for learning how to code than math
++++++++++[>+++++++>++++++++++>+++>+<<<<-]>++.>+.+++++++..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.>.

Here’s how you add “5” and “2” together.

++       Cell c0 = 2
> +++++  Cell c1 = 5

[        Start your loops with your cell pointer on the loop counter (c1 in our case)
< + Add 1 to c0 > -      Subtract 1 from c1
]        End your loops with the cell pointer on the loop counter

At this point our program has added 5 to 2 leaving 7 in c0 and 0 in c1
BUT we cannot output this value to the terminal since it's not ASCII encoded!

To display the ASCII character "7" we must add 48 to the value 7!
48 = 6 * 8 so let's use another loop to help us!

++++ ++++  c1 = 8 and this will be our loop counter again
[
< +++ +++ Add 6 to c0 > -        Subtract 1 from c1
]
< .        Print out c0 which has the value 55 which translates to "7"!

To understand how to write code in Brainfuck, there’s a great resource over at Stackoverflow and even a Brainfuck for dummies guide.

Though practically impossible to make high-level programs with Brainfuck, theoretically you could design software just as good as anything in C++ or Java. Being Turing complete means the Brainfucked machine can solve any problem given enough time and memory. It’s writing the code that’s challenging.

In the intervening two decades since Müller first designed his programming language, other fellow code alchemists responded with their own versions and derivatives. In DerpPlusPlus some of the commands you can use are ‘HERP’, ‘DERP’, ‘GIGITY’, etc.  Ook! maps brainfuck’s eight commands to two-word permutations of “Ook.”, “Ook?”, and “Ook!”, and is supposedly made to be “writable and readable by orang-utans”. For instance, ‘Hello, world!’ in Ook! looks like:

Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.

The oddest Brainfuck derivative might be Bodyfuck which uses a gesture-controlled system so that movements are turned into some of the eight available commands. Here’s how you write ‘Hello, world!’ in Bodyfuck.

https://vimeo.com/11976599

There are over 200 esoteric programming languages, many inspired by Brainfuck and some completely hilarious. To print ‘Hello, world!’ in Beatnik you have to write an 80-line poem, in Chef you have to write a recipe, and in DNA# the code is made from strings of A, T, G, C arranged in a helix.

Tags: programming

Share24TweetShare
Tibi Puiu

Tibi Puiu

Tibi is a science journalist and co-founder of ZME Science. He writes mainly about emerging tech, physics, climate, and space. In his spare time, Tibi likes to make weird music on his computer and groom felines. He has a B.Sc in mechanical engineering and an M.Sc in renewable energy systems.

Related Posts

Future

A Software Engineer Created a PDF Bigger Than the Universe and Yes It’s Real

byTibi Puiu
1 month ago
Computer Science & IT

What’s the difference between programming and coding?

byTibi Puiu
2 years ago
Future

Microsoft releases simple “auto-complete for programmers” that uses mammoth AI

byMihai Andrei
4 years ago
News

Language skill may matter more for learning how to code than math

byTibi Puiu
5 years ago

Recent news

Barbie’s Feet Have Something to Say About Modern Womanhood

May 15, 2025

The Best Archaeopteryx Fossil Ever Found Just Showed It Could Fly

May 14, 2025

Earliest Reptile Footprints Found By Amateur Paleontologist in 355-Million-Year-Old Rock Push Back the Dawn of Land Animals

May 14, 2025
  • About
  • Advertise
  • Editorial Policy
  • Privacy Policy and Terms of Use
  • How we review products
  • Contact

© 2007-2025 ZME Science - Not exactly rocket science. All Rights Reserved.

No Result
View All Result
  • Science News
  • Environment
  • Health
  • Space
  • Future
  • Features
    • Natural Sciences
    • Physics
      • Matter and Energy
      • Quantum Mechanics
      • Thermodynamics
    • Chemistry
      • Periodic Table
      • Applied Chemistry
      • Materials
      • Physical Chemistry
    • Biology
      • Anatomy
      • Biochemistry
      • Ecology
      • Genetics
      • Microbiology
      • Plants and Fungi
    • Geology and Paleontology
      • Planet Earth
      • Earth Dynamics
      • Rocks and Minerals
      • Volcanoes
      • Dinosaurs
      • Fossils
    • Animals
      • Mammals
      • Birds
      • Fish
      • Amphibians
      • Reptiles
      • Invertebrates
      • Pets
      • Conservation
      • Animal facts
    • Climate and Weather
      • Climate change
      • Weather and atmosphere
    • Health
      • Drugs
      • Diseases and Conditions
      • Human Body
      • Mind and Brain
      • Food and Nutrition
      • Wellness
    • History and Humanities
      • Anthropology
      • Archaeology
      • History
      • Economics
      • People
      • Sociology
    • Space & Astronomy
      • The Solar System
      • Sun
      • The Moon
      • Planets
      • Asteroids, meteors & comets
      • Astronomy
      • Astrophysics
      • Cosmology
      • Exoplanets & Alien Life
      • Spaceflight and Exploration
    • Technology
      • Computer Science & IT
      • Engineering
      • Inventions
      • Sustainability
      • Renewable Energy
      • Green Living
    • Culture
    • Resources
  • Videos
  • Reviews
  • About Us
    • About
    • The Team
    • Advertise
    • Contribute
    • Editorial policy
    • Privacy Policy
    • Contact

© 2007-2025 ZME Science - Not exactly rocket science. All Rights Reserved.