LOLCODE

LOLCODE is an esoteric programming language inspired by the language expressed in examples of the lolcat Internet meme. The language was created in 2007 by Adam Lindsay, researcher at the Computing Department of Lancaster University.

The language is not clearly defined in terms of operator priorities and correct syntax, but several functioning interpreters and compilers already exist. The language has been proven Turing-complete by the implementation of a Brainfuck compiler.

Language structure and examples
LOLCODE is written in heavily compressed (shortened) English Internet slang, and a person who understands this slang can often understand a LOLCODE program without prior experience. Here follows a Hello world program and a simple program to output a file to a monitor. Highly accessible, similar code was printed in the Houston Chronicle.

Example 1: HAI CAN HAS STDIO? VISIBLE "HAI WORLD!"

KTHXBYE


 * {| class="wikitable" width="80%"

! Code ! Comment
 * In all LOLCODE programs, HAI introduces the program.
 * In many programming languages, one of the first statements will be a library inclusion for common functions such as input and output. Typically this is included by a call such as #include  [ stdio standing for standard input/output library]. This command is a tongue in cheek corruption of that, asking if a file is obtainable, obtaining it if possible, and raising an exception if not . It is there primarily for authenticity — in fact, it is ignored in current implementations of LOLCODE.
 * In all LOLCODE programs, HAI introduces the program.
 * In many programming languages, one of the first statements will be a library inclusion for common functions such as input and output. Typically this is included by a call such as #include  [ stdio standing for standard input/output library]. This command is a tongue in cheek corruption of that, asking if a file is obtainable, obtaining it if possible, and raising an exception if not . It is there primarily for authenticity — in fact, it is ignored in current implementations of LOLCODE.
 * In many programming languages, one of the first statements will be a library inclusion for common functions such as input and output. Typically this is included by a call such as #include  [ stdio standing for standard input/output library]. This command is a tongue in cheek corruption of that, asking if a file is obtainable, obtaining it if possible, and raising an exception if not . It is there primarily for authenticity — in fact, it is ignored in current implementations of LOLCODE.
 * In many programming languages, one of the first statements will be a library inclusion for common functions such as input and output. Typically this is included by a call such as #include  [ stdio standing for standard input/output library]. This command is a tongue in cheek corruption of that, asking if a file is obtainable, obtaining it if possible, and raising an exception if not . It is there primarily for authenticity — in fact, it is ignored in current implementations of LOLCODE.


 * prints a message to the screen.
 * introduces the program, so  (meaning "Cool (kool) — thanks — bye!") terminates it.
 * }
 * introduces the program, so  (meaning "Cool (kool) — thanks — bye!") terminates it.
 * }

Example 2: HAI CAN HAS STDIO? PLZ OPEN FILE "LOLCATS.TXT"? AWSUM THX VISIBLE FILE O NOES INVISIBLE "ERROR!"

KTHXBYE

In this example, commands to open a file ( — "Please try to open a file?"), and error handling (  — "Awesome, thanks!", and   — "Oh no!") are introduced.

Other commands include  for declaring variables,   ("laughter [at] variable [is/are/being] value") for assigning them, sending error messages to the front end via   instead of , and   ("by the way") to denote a comment, making the parser ignore the rest of the line. Loops are created with IM IN YR label</tt> (from an internet meme "I'm in your ___"), and ended with KTHX</tt> ("okay-thanks!"). Loops lack counters or conditions, and thus do not cease inherently. They must be manually broken with the  (deprecated in favor of   – "enough" in Leetspeak) command. Loops can also be ended with the conditional  command:

Example 3: HAI CAN HAS STDIO? I HAS A VAR IM IN YR LOOP UP VAR!!1 IZ VAR BIGGER THAN 10? KTHX VISIBLE VAR IM OUTTA YR LOOP KTHXBYE

This simple program displays the numbers 1–10 and terminates (as of specification 1.0). The same program as of specification 1.2 is (assuming VAR starts at 0):

HAI CAN HAS STDIO? IM IN YR LOOP UPPIN YR VAR TIL BOTHSAEM VAR AN 10 VISIBLE SUM OF VAR AN 1 IM OUTTA YR LOOP KTHXBYE

Implementations
There is a .NET compiler for LOLCODE written by Nick Johnson, and featured in Microsoft developer training seminars, TechEd 2007 Conference (Australia).

PL/LOLCODE, a project headed by Josh Tolley, makes LOLCODE available as a server-side programming language inside PostgreSQL.

Microsoft Dynamic Language Runtime has an implementation of LOLCODE for testing purposes.

A JavaScript interpreter is also available

There is also a LOLCODE compiler included with the Parrot virtual machine as one of the languages demonstrating the use of Parrot's compiler tools.