LOLCODE

LOLCODE

LOLCODE is an esoteric programming language inspired by the language expressed in examples of the LOLCAT Internet meme.cite web
author = Dwight Silverman
title = I'M IN UR NEWSPAPER WRITIN MAH COLUM
publisher = Chron.com
date = 2007-06-06
url = http://www.chron.com/disp/story.mpl/business/silverman/4862013.html
accessdate = 2007-06-06
] The language was created in 2007 by Adam Lindsay, researcher at the Computing Department of Lancaster University. [ [http://www.comp.lancs.ac.uk/department/news.html Lancaster University Computing Department News] ]

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. [cite web
author=Arachnid
title=Proof that LOLCode is turing complete:BrainF*** interpreter in LOLCode
url=http://forum.lolcode.com/viewtopic.php?id=51
publisher=forum.lolcode.com
accessdate=2008-10-05
]

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 cite web
author = Adam Lindsay
title = LOLCODE main page
publisher = lolcode.com
date = 2007-05-25
url = http://www.lolcode.com"
accessdate = 2007-10-02
]

::

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"? — "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 VISIBLE, and 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 KTHX ("okay-thanks!"). Loops lack counters or conditions, and thus do not cease inherently. They must be manually broken with the (deprecated in favor of ENUF – "enough" in Leetspeak) [ [http://www.sorn.net/~sandyd/blog/lolcode-mono-osx.pngSORN.net] ] command. Loops can also be ended with the conditional IZ 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, [ [http://lolcode.net LOLCODE .NET compiler] at Google Code] and featured in Microsoft developer training seminars, TechEd 2007 Conference (Australia). [ [http://www.istartedsomething.com/20070809/teched-day-2-lolcode/ TechEd Day 2: Microsoft announces LOLCode support] , Long Zheng] [ [http://www.networkworld.com/community/node/18296 LOLcode in next Visual Studio? For young and funny cats] , NetworkWorld.com] [ [http://blip.tv/file/343052 Video of LOLCODE presentation at TechEd 2007] ]

PL/LOLCODE, a project headed by Josh Tolley, makes LOLCODE available as a server-side programming language inside PostgreSQL. [ [http://pgfoundry.org/projects/pllolcode/ PL/LOLCODE] , pgFoundry]

Microsoft Dynamic Language Runtime has an implementation of LOLCODE for testing purposes. [ [http://channel9.msdn.com/showpost.aspx?postid=392011 Deep DLR] , John Lam and Martin Maly]

References

External links

* [http://lolcode.com/ LOLCODE Official website]
* [http://www.dalkescientific.com/writings/diary/archive/2007/06/01/lolpython.html LOLPython]
* [http://edition.cnn.com/2008/TECH/05/01/roflcon/index.html The new fame: Internet celebrity] , CNN article


Wikimedia Foundation. 2010.

Игры ⚽ Поможем написать курсовую

Look at other dictionaries:

  • LOLCODE — LOLCODE  эзотерический язык программирования, созданный под влиянием интернет мема о lolcat’ах. На официальном сайте находится спецификация[1] этого языка, и, хотя некоторые моменты в ней не описаны, уже существуют несколько работающих… …   Википедия

  • LOLCODE — Apparu en 2007 Auteur Adam Lindsay LOLCODE est un langage de programmation exotique inspiré de l argot Internet et du Lolcat retrouvable sur les chats et forums anglais. La priorité des opérateurs et …   Wikipédia en Français

  • LOLCODE — Este artículo o sección necesita referencias que aparezcan en una publicación acreditada, como revistas especializadas, monografías, prensa diaria o páginas de Internet fidedignas. Puedes añadirlas así o avisar …   Wikipedia Español

  • Weird Programming — Esoterische Programmiersprachen sind Programmiersprachen, die nicht für den praktischen Einsatz entwickelt wurden, sondern ungewöhnliche Sprachkonzepte umsetzen. Eine einfache Bedienung ist selten, teilweise werden Sprachen konzipiert, um… …   Deutsch Wikipedia

  • Brainfuck — Класс языка: эзотерический Появился в: 1993 Автор(ы): Урбан Мюллер Диалекты: BrainSub, Brainfork, Brainloller, COW, Ook, Pbrain, Smallfuck, Spoon, LOLCODE, Whitespace,DoubleFuck, Feckfeck Испытал влияние …   Википедия

  • PostgreSQL — Developer(s) PostgreSQL Global Development Group Stable release 9.1.1[1] / 9.0.5 …   Wikipedia

  • List of CLI languages — Contents 1 CLI languages 2 Related 3 See also 4 References …   Wikipedia

  • Lolcat — A lolcat …   Wikipedia

  • Esoterische Programmiersprache — Esoterische Programmiersprachen sind Programmiersprachen, die nicht für den praktischen Einsatz entwickelt wurden, sondern ungewöhnliche Sprachkonzepte umsetzen. Eine einfache Bedienung ist selten, teilweise werden Sprachen konzipiert, um… …   Deutsch Wikipedia

  • Liste der Dateiendungen/L — In dieser Liste sind übliche Dateinamenserweiterungen aufgelistet, die in einigen Betriebssystemen (wie zum Beispiel Microsoft Windows) zur Unterscheidung von Dateiformaten verwendet werden. In anderen Betriebssystemen erfolgt die… …   Deutsch Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”