Text

LOLCODE

nines19:

thetaylordetroye:

beeaaarrrr:

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. One interpretation of the language has been proven Turing-complete.
Language structure and examples

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. Similar code was printed in the Houston Chronicle.
Example 1

HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE


HAI: In all LOLCODE programs, HAI (“Hi!”) introduces the program.

CAN HAS [LIBRARY]? : 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 library 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.

VISIBLE [MESSAGE]: prints a message to the screen.

KTHXBYE: Just as HAI introduces the program, KTHXBYE (meaning “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”? — “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, variable R value (“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 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 IZ 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 (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 BOTH SAEM VAR AN 10
    VISIBLE SUM OF VAR AN 1
IM OUTTA YR LOOP
KTHXBYE



Implementations

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.

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.

MicrosoftDynamic Language Runtime has an implementation of LOLCODE for testing purposes.

A LOLCODE to JavaScript translator 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.

A low-level interpreter written in C exists, maintained by Justin J. Meza, to provide native LOLCODE interpretation on a variety of platforms.


Related projects
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.

oh my god this is the best thing i’ve read all day

i just spent like five minutes actually figuring out how to apply this code to my current computer science programs

oh my gosh this is amazing

I’ve been wanting to write a compiler or interpreter for LOLCODE for a long time…

(Source: Wikipedia)

Photo
transparrotfish:

Hi all! I’ve just joined the admin team to help out on the page.
Hope all you T-Rex’s are doing great :) ~ Jameh

transparrotfish:

Hi all! I’ve just joined the admin team to help out on the page.

Hope all you T-Rex’s are doing great :) ~ Jameh

Text

You wouldn’t want to have an orgasm either if every one was traumatizing.

Tags: sex trans
Text

I haven’t been on Tumblr in f.o.r.e.v.e.r. I’ve just been way too busy. But, I thought I’d say hi.

HI!

Tags: meta
Photo
Chillin&#8217; in Dr. Bowers&#8217; office

Chillin’ in Dr. Bowers’ office

Text

Court

Going full time next week. Going to court tomorrow to file my name change paperwork. 

Let it begin.

Text

wide-worlds-joy replied to your post: Oh my god I’m going to be full time next week. I…

OH, good luck honey! I’m here for you if you want to talk about it…. I’m right there with you.

Thanks dear. I hope it’s going well! *hugs*

Text

see-reverse-side replied to your post: Oh my god I’m going to be full time next week. I…

yay! I’m glad to hear. best of luck. the first few weeks are pretty stressful, from personal experience. really, best of luck!

That’s what I’ve heard. My girlfriend is standing by for lots of cuddles. :)

Text

ellierantsforever replied to your post: Oh my god I’m going to be full time next week. I…

omfg omfg omfg you win all the awards

Haha. Thanks.

*takes a bow* :P

Text

Oh my god I’m going to be full time next week. I don’t think it’s hit me quite yet. There’s plenty to be nervous about, but I have a supportive boss, superboss, HR rep, and a few (so far) supportive peers.

Tags: trans fulltime