|Designed by||Adam Lindsay|
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 interpreter.
Language structure and examples Edit
LOLCODE's keywords are drawn from the heavily compressed (shortened) patois of the lolcat Internet meme. 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.
HAI CAN HAS STDIO? VISIBLE "HAI WORLD!"
In all LOLCODE programs, HAI introduces the program.
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.h> [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.
HAIintroduces the program, so
KTHXBYE(meaning "Okay — thanks — bye!") terminates it.
HAI CAN HAS STDIO? PLZ OPEN FILE "LOLCATS.TXT"? AWSUM THX VISIBLE FILE O NOES INVISIBLE "ERROR!"
In this example, commands to open a file (
PLZ OPEN FILE "NAME"? — "Please try to open a file?"), and error handling (
AWSUM THX — "Awesome, thanks!", and
O NOES — "Oh no!") are introduced.
Other commands include
I HAS A variable for declaring variables,
LOL variable R value ("laughter [at] variable [is/are/being] value") for assigning them, sending error messages to the front end via
INVISIBLE instead of
BTW ("by the way") to denote a comment, making the parser ignore the rest of the line. Loops are created with IM IN YR label (from an internet meme "I'm in your ___"), and ended with IM OUTTA YR label. Loops lack counters or conditions, and thus do not cease inherently. They must be manually broken with the
ENUF, "enough" in Leetspeak (old version
GTFO)  command. Loops can also be ended with the conditional
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
The first LOLCODE implementation was a PHP parser written by Jeff Jones. The parser's website was also the first website using LOLCODE as an actual web scripting language. Being open source with a BSD style license, it has been forked and used by multiple websites to implement LOLCODE scripting. The winning Pecha Kucha presentation at PHP Works 2008 was about this parser.
PL/LOLCODE, a project headed by Josh Tolley, makes LOLCODE available as a server-side programming language inside PostgreSQL.
LOLCODE has also inspired LOLPython, written by Andrew Dalke. LOLPython uses LOL-inspired syntax similar to that of LOLCODE, but with a Python-like style. It operates by translating the LOLPython source into Python code.
- ↑ 1.0 1.1 Dwight Silverman (2007-06-06). "I'm in ur newspaper writin mah colum". Chron.com. http://www.chron.com/disp/story.mpl/business/silverman/4862013.html. Retrieved 2007-06-06.
- ↑ "Lancaster University Computing Department News". Comp.lancs.ac.uk. http://www.comp.lancs.ac.uk/department/news.html. Retrieved 2009-06-09.
- ↑ Arachnid. "Proof that LOLCode is turing complete:BrainF*** interpreter in LOLCode". forum.lolcode.com. http://forum.lolcode.com/viewtopic.php?id=51. Retrieved 2008-10-05.
- ↑ 4.0 4.1 4.2 Adam Lindsay (2007-05-25). " "LOLCODE main page". lolcode.com. http://www.lolcode.com". Retrieved 2007-10-02.
- ↑ "keywords:can-has · LOLCODE". http://lolcode.com/keywords/can-has. Retrieved 2008-02-10.
- ↑ SORN.net[dead link]
- ↑ "First Parser Comment". Lindsay.at. http://lindsay.at/blog/archive/2007/05/21/lolcode.html#comment853. Retrieved 2009-06-09.
- ↑ "Tetraboy's LOLCODE parser". Tetraboy.com. http://www.tetraboy.com/lolcode/. Retrieved 2009-06-09.
- ↑ ""The Best Web Language: LOLCODE" Slides". Slideshare.net. http://www.slideshare.net/Tetraboy/the-best-web-language-lolcode. Retrieved 2009-06-09.
- ↑ PHP Works
- ↑ LOLCODE .NET compiler at Google Code
- ↑ TechEd Day 2: Microsoft announces LOLCode support, Long Zheng
- ↑ LOLcode in next Visual Studio? For young and funny cats, NetworkWorld.com
- ↑ "Video of LOLCODE presentation at TechEd 2007". Blip.tv. 2007-08-17. http://blip.tv/file/343052. Retrieved 2009-06-09.
- ↑ PL/LOLCODE, pgFoundry
- ↑ Deep DLR, John Lam and Martin Maly
- ↑ "LolCode". Fullvolume.co.uk. http://fullvolume.co.uk/static/lolcode/. Retrieved 2009-06-09.
- ↑ "Lightning-Parrot". lolcode.com. http://lolcode.com/news/lightning-parrot. Retrieved 2009-06-20.
- ↑ http://www.icanhaslolcode.org/ I Can Has lolcode? - an efficient LOLCODE interpreter written in C.
- ↑ "LOLPython". Dalkescientific.com. 2007-06-01. http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html. Retrieved 2009-06-09.
- Article at the French Wikipedia
- Article at the Icelandic Wikipedia
- Article at the Italian Wikipedia
- Article at the Polish Wikipedia
- Article at the Russian Wikipedia
- Article at the Finnish Wikipedia
- Article at the Chinese Wikipedia
|This page uses Creative Commons Licensed content from Wikipedia (view authors).|