When it comes to development there is a programming language for every situation. Languages are optimized for metrics like speed and usability while doing their best to minimize the tradeoffs. New languages are built from their predecessors, correcting past mistakes and inventing new paradigms. While these noble languages have produced many solutions in a wide variety of fields, not all languages are created equal. Some languages shouldn’t be used for any projects. Esoteric Programming Languages are known to be incredibly complex, unusable and nonsensical. At the same time, many of these languages are Turing Complete, meaning they can solve any computer problem a regular programming language can. Let’s look at a few of these impractical monstrosities.
Befunge is a stack based language where the goal was to be as difficult to compile as possible. The code uses arrows to control the program flow where the characters < ^ v > point in the direction of the next command to execute. The code can also modify itself, meaning the app may perform completely differently by the time it terminates. Here is an example that computes a factorial:
The program starts with user input with the “&” character. It pushed numbers 5 thru 1 in onto the stack using a “loop”. Then it loops through the stack again multiplying the values together until it outputs the factorial. Though the goal of this language was to be as hard as possible to compile, developers like a challenge and several working compilers have been created. In fact, this language has been extended further in a child language called Funge. The largest difference is you are no longer limited to a 2-dimensional plane to write your code. If this code wasn’t already difficult to understand you can now write the directional code in 3 or more dimensions!
Developers have a wide range of preferences when it comes to formatting code. Many discussions have devolved to vicious arguments over using tabs vs space and how to indent your code. Most languages will ignore formatting to accommodate personal tastes. The next language, Whitespace, completely reverses this concept. The Whitespace programming language ignores everything but spaces, tabs and new lines. Different combinations of whitespace characters perform different actions in this stack and heap based language. Below is the classic “Hello World!” function in Whitespace:
It’s impossible to read without syntax highlighting and comments, takes many lines to do anything, and extremely difficult to debug. I wish you the best of luck if you ever attempt to use it.
Programming languages come in all shapes and sizes. Unorthodox languages provide an interesting look at what programming paradigms are possible. It is fun to mess around with Esoteric Programming Languages to see what unique solutions can be created for simple problems. Don’t forget, the code might look different but in the end it is all 1s and 0s.