What? you might ask yourself while thinking of the notion
esoteric in combination with
programming languages.
How can that two fit together?
Well, life is full of contradictions which very well might end up in a dialectic conclusion, as you will see in this example. In the normal case, programming languages claim to be easy to learn and use, yet powerful. Furthermore, each programming language is made for special purposes, that is why so many of them exist. Their purpose is a rationalistic one: the programming language as a tool to solve a computable problem.
Esoteric programming languages have no rationalistic approach. Their subject is themselves. It is about to use a programming language for the sake of programming, not for the sake of solving a certain problem. Reads like pretty fun-for-nerds stuff? Well, you're right.
Intercal
Let's take
Intercal for the first example. Intercal is a programming language, written in 1972 which purpose it was to make programming as – guess what – hard as possible. You guys know the GOTO instruction from older programming languages? Intercal uses "ComeFrom", which pretty much says it all. The Intercal programmer must use the modifier "PLEASE" regularly, otherwise the compiler refuses to process the code, since it is too impolite. The syntax rules finally make every ordinary programmer confused, which was another aim of Intercal: to make the code as hard to read as possible. This is a Hello, World program in Intercal:
DO ,1 <- #13
PLEASE DO ,1 SUB #1 <- #234
DO ,1 SUB #2 <- #112
DO ,1 SUB #3 <- #112
DO ,1 SUB #4 <- #0
DO ,1 SUB #5 <- #64
DO ,1 SUB #6 <- #194
DO ,1 SUB #7 <- #48
PLEASE DO ,1 SUB #8 <- #22
DO ,1 SUB #9 <- #248
DO ,1 SUB #10 <- #168
DO ,1 SUB #11 <- #24
DO ,1 SUB #12 <- #16
DO ,1 SUB #13 <- #214
PLEASE READ OUT ,1
PLEASE GIVE UP
The output is nothing more than the famous "Hello, world!" in the prompt.
Compare it with Python:
print "Hello, world!"
A 6 year old would understand this.
All this properties makes Intercal one of the hardest to write and hardest to read languages. Perfect for torturing a computer science freshman.
Ook!
The devlopers say, that
Ook! was developed as a programming language for Orangutans. No kidding. Maybe that is why Ook! is easy to learn (but hard to master). Okay, that is of course only half the truth, since Ook! only knows the three Syntax Elements
Ook.
Ook?
Ook!
Nevertheless, Ook! is Turing complete realized by the combinations of the use of the three Ooks. (what basically means that you can implement every computable problem in this language). Well, it certainly takes its time, as you will see in the Hello, World example:
Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook.
Ook! Ook. Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook?
Ook! Ook! Ook? Ook! Ook? Ook. Ook. Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook. Ook! Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook.
Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook! Ook? Ook? Ook. Ook. Ook.
Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook. Ook? Ook! Ook! Ook? Ook! Ook? Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook? Ook. Ook? Ook. Ook? Ook. Ook? Ook. Ook! Ook. Ook. Ook. Ook. Ook. Ook. Ook.
Ook! Ook. Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook.
Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook! Ook!
Ook! Ook. Ook. Ook? Ook. Ook? Ook. Ook. Ook! Ook.
Whitespace
As most of the other esoteric programming languages,
Whitespace is pretty hard to master and you need more time to come to a solution compared to mainstream languages. Whitespace got its name from the fact, that the code is composed not of characters but control statements (such statements are space, line break, tabulator, etc.). Without any highlighting or display of control statements in an editor, Whitespace code cannot be seen at all. Whith syntax highlighting, a listing looks for instance like this:

Whitespace reverses the fact, that compilers do not need any control statements, meaning that they don't need any formatting at all. Formatting the code is done for the better reading of it by humans. And take this into account: the developers of Whitespace state, that one advantage of it is to save ink when you print the code.
Piet
What is beautiful code? We learned from the previous example that formatting makes it easy to read, more efficient to read. That's one thing. Another property of beautiful code is that the rules of the language are efficiently and intelligently used by the programmer, without getting hard to read for an outsider.
Piet literally might make code beautiful in its very visual sense. The program code is made out of a matrix of colored pixels. The position and color of a pixel establishes the syntax, while their context creates the semantic. A Piet program might look like this:

You can see why this language is called Piet since it certainly resembles a painting by Piet Mondrian. A Hello, World program looks completely different:

Thanks to Piet, the contradiction of aesthetics and algorithm is solved!
No comments. Comments are closed for this archived post.