Sunday, February 06, 2005

Esoteric Home Languages

[Beware... it's definitely a long'un!]

Here's an interesting concept, for programmers bored with the mundane logic and common sense of conventional languages like C++ and Java. I stumbled upon this wiki and entered the world of Esoteric Programming Languages!

Esoteric: ["Es@tErIk]
adj.
Intended for or understood by only a particular group

The esoteric languages are semi-jokes which make the source code appear obfuscated. They also pride themselves on having extremely long source, even for simple programs like Hello World. One of the earlier languages, the controversially named Brainf*** has source code using only characters such as '>', '+' and '['. The Hello World program for this language is as follows:

++++++++++
[
    >+++++++>++++++++++>+++>+<<<<-
]
>++.
>+.
+++++++.
.
+++.
>++.
<<+++++++++++++++.
>.
+++.
------.
--------.
>+.
>.
Which is pretty cool. See the Brainf*** wiki (and be careful, it uses the letters 'u', 'c' and 'k') for an explanation on how this code works.

While Brainf*** is very low level, there are some other, more creative languages. David Morgan-Mar A.K.A. "DangerMouse" has designed a number of hilarious and clever languages.
DM's Esoteric Programming Lanaugages
All of them are jokes (most of which actually can be useful languages), and they're all worth a look. Beyond this, some of them actually represent some new programming paradigms, which, while mostly impractical, are cleverly designed.
In particular, Chef and Haifu are some high-level languages with impressive source code. The former makes your code look like a recipe, while the latter makes it look like an asian-philosophy haiki poem.

BIT makes for some highly ridiculous-looking programs, Piet's source code is a bitmap, and LenPEG represents a compression algorithm millions of times greater than normal ones (on certain cases).

HQ9+ is a great idea. Since people will often note a language's ease-of-use by looking at the Hello World program, the designer of HQ9+, Cliff L. Biffle, created a language with the shortest possible Hello World program:
H
As the name states, the program has just four commands: H, Q, 9 and +. The "Q" command does something extremely difficult in most languages: prints out a "Quine" or a copy of the program's own source code. The "9" prints the words to the song "99 Bottles of Beer", and the "+" increments the accumulator. As you can see, the language makes certain tasks extraordiarily easy. All other tasks are impossible.

The other language I wanted to point out was Shakespeare. This one seems to be one of the most well-fleshed out. Their website is a little out of commission at the moment, but you can still download the interpreter and the documentation.
Shakespeare Programming Language (SPL)
This language's code appears as a Shakspearean play. It forms very realistic-looking code, as demonstrated by this Hello World:
    Act II: Behind Hamlet's back.

    Scene I: Romeo and Juliet's conversation.

[Enter Romeo and Juliet]

Romeo:
 Speak your mind. You are as worried as the sum of yourself and the difference between my small smooth hamster and my nose. Speak your mind!

Juliet:
 Speak YOUR mind! You are as bad as Hamlet! You are as small as the difference between the square of the difference between my little pony and your big hairy hound and the cube of your sorry little codpiece. Speak your mind!

[Exit Romeo]
Update: This is actually only part of the source! The full Hello World is about four times longer and can be found here. (In case anyone's wondering why I didn't see this link on the wiki earlier, it's because I just added it myself!)

So... Esoterics are all-in-all completely useless when compared to actual programming languages, but this in no way stops them from being fun and clever. Definitely worth a long look.

Note: For anyone interested in what a normal Hello World program is for comparison, this is the standard C Hello World:
#include <stdio.h>

int main(void)
{
    printf("Hello World!\n");
    return 0;
}
The Hello World program simply prints the text "Hello World!" to the screen. Read more examples here.

"Well, that was fun. Useless, but fun."
- Dalboz of Gurth, Zork Grand Inquisitor

7 Comments:

At 6:50 pm, Blogger Andrew said...

awaiting an esoteric language from you!

 
At 9:01 pm, Blogger Toria/Deb said...

Trust Matt to come up with this post LOL! :) Yes, where's your esoteric contribution? That would be interesting to see, indeed. Hope you are having fun.

 
At 10:21 pm, Blogger Eat_My_Shortz said...

Well, there is one coming. Its pretty crap actually. But I will make it anyway and see what happens.
You too AndE!

Right now I'm writing a Brainf*** interpreter because its actually a very interesting language, despite the name!

 
At 12:12 am, Anonymous Anonymous said...

When you're done could you write a game in it? Maybe port Quake 1 ... I believe the source is readily available on the Internet.

 
At 6:19 am, Anonymous Anonymous said...

That's the irony of marriage as heterosexual couples. That means little is known about its long-term benefits or its possible side effects of MAO inhibitors and SSRI s and possibly increase the risk of pregnancy. The incentive is clear: studies have shown that regular bouts of gentle weeding, digging and mowing can revitalise a man's flagging natural sexual
enhancement herbs.

My page ... Where To Buy Vimax Pills

 
At 2:04 pm, Anonymous Anonymous said...

Shakeology Ingredient ACAI BERRY- Acai Berries are amongst the most common cause of cellulitis in young children before the vaccine for this bacterium has been developed.
These foods are high in caffeine and sugars, breast enhancement music fat, cholesterol,
obesity and diabetes.

Look into my blog post: Breast Enlargement

 
At 9:48 am, Anonymous Anonymous said...

However, changing these habits lose weight keep curves is within your hands.
If she had neutralized her underlying compulsion to
eat. When you get in a slump, you start doing abdominal exercises, it is possible
to replace these causes with healthier alternatives.

Also visit my web site ... what s the lemonade diet

 

Post a Comment

<< Home