LOLCODE

LOLCODE is a humorous esoteric programming language heavily inspired by structures found in many common programing languages, as modified to be expressed via common terms, stylings and informal spellings found in Internet memes (primarily lolcats) and the communication style found in internet slang, instant messenger chat, and cellphone text messaging ("TXT"), rather than the numerically-based l33t. The name itself comes from the expression "LOL".

The language is not (yet) clearly defined in terms of operator priorities and correct syntax, but several functioning interpreters and compilers already exist. The .NET implementation has been featured by Microsoft in their developer training seminars in Australia, at the TechEd 2007 Conference.

History
LOLCODE began with Lolcats, a social networking site where cat lovers would post amusing pictures of their cats, with captions. The language used developed into its own subgenre. LOLCODE is an attempt to produce a programming language based upon the grammatical style of lolcats.

Language structure and examples
LOLCODE is written in heavily compressed 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
 * HAI
 * In all LOLCODE programs, HAI (an internet slang misspelling of "hi") introduces the program.
 * CAN HAS [FILE]?
 * CAN HAS [FILE]?
 * CAN HAS [FILE]?


 * 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 accepting if not. It is there primarily for authenticity - in fact it is ignored in current implementations of LOLCODE.
 * VISIBLE [MESSAGE]
 * prints a message to the screen.
 * KTHXBYE</tt>
 * KTHXBYE</tt>
 * KTHXBYE</tt>


 * As HAI</tt> introduces the program, so KTHXBYE</tt> (an internet brevification of "Okay - 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 (PLZ OPEN FILE "NAME"?</tt> -- "Please try to open a file?"), and error handling (AWSUM THX</tt> -- "Awesome, thanks!", and O NOES</tt> -- "Oh no!") are introduced.

Other commands include I HAS A variable</tt> for declaring variables, LOL variable R value</tt> ("laughter [at] variable [is/are/being] value") for assigning them, sending error messages to the front end via INVISIBLE</tt> instead of VISIBLE</tt>, and BTW</tt> ("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 GTFO</tt> command. Loops can also be ended with the conditional IZ</tt> command:

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

This simple program displays the numbers 1-10 and terminates.