An Esoteric Programming Language
"...you will still desire to use Perl because, well, Perl’s syntax is very close to LOLCODE’s" - Beer Planet
I am going to have a lot of people not believe me as they read this, but LOLCODE is a real computer programming language. According to its website, it came into the world on the 25th of May, 2007. It was quickly followed by delight from many geeks, with a smattering of despair and hand-wringing on the part of serious programmers the world over. At the time of writing, one of the implementations is Turing complete, basically meaning it is (pardon me for saying this) TEH AWESUM. I'm not entirely certain what this means to computer scientists, except that it can do pretty much what any other Turing machine can do. But it must be good, right?
The language uses words couched in similar tones to those used in the lolcat Internet meme. Wikipedia points out that the language is "not clearly defined" in every aspect, in particular priorities and syntax, but that keywords are expressed in block capitals. The spelling of these words is enough to make an English teacher's head spin. Not that many English teachers will be reading LOLCODE, let alone writing any, and let's face it, there are many peculiar words and uses in other computer languages. So let's leave the teachers behind and move right along.
The Inevitable "Hello World"
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
To which I feel another demonstration program should be added, which displays numbers from 1 to 10.
CAN HAS STDIO?
IM IN YR LOOP UPPIN YR VAR TIL BOTH SAEM VAR AN 10 BTW This starts to loop
VISIBLE SUM OF VAR AN 1
IM OUTTA YR LOOP BTW This ends the loop
In these two examples it can be seen that
HAI (for "hi!", obviously) introduces the program, and
KTHXBYE ("okay, thanks, goodbye") terminates it. Comments, if you need them are preceded with
BTW, sensibly enough. Variables, should you want them, are expressed as
I HAS A variable.
There are not too many examples of the language in daily use, but many of LOLCODE's many supporters have developed all sorts of small demonstrations, but I have been unable to find anything remotely valuable implemented in this language. Like many similar languages, it seems to exist as a joke proof of concept rather than anything remotely useful in the real world. As such, it will probably remain a curiosity along with its cousins Brainfuck, Shakespeare and Whitespace, not to mention Malbolge.¹
Other than the website there is not a good deal of documentation of the language, just a jokey reference to an O RLY book LOLCODE IN UR NUTSHELLS. Rumours that E2 will be rewritten in LOLCODE are unsubstantiated.
¹ Correction: There exists the basis for a chess program in LOLCODE, here.