LOLCODE
An esoteric programming language inspired by lolspeak and the lolcat Internet meme, featuring keywords like HAI, KTHXBYE, and VISIBLE.
Created by Adam Lindsay
LOLCODE is an esoteric programming language inspired by the “lolspeak” language used in lolcat memes. Created in 2007 by Adam Lindsay at Lancaster University, it translates traditional programming constructs into the deliberately broken English style of Internet cat memes.
History & Origins
In the mid-2000s, the lolcat meme emerged on imageboards and spread across the Internet. Images of cats with humorous captions written in “lolspeak” - a form of intentionally misspelled, grammatically incorrect English - became wildly popular, particularly after the launch of “I Can Has Cheezburger?” in early 2007. Phrases like “I CAN HAS CHEEZBURGER?” entered Internet vocabulary.
In 2007, Adam Lindsay, a researcher at Lancaster University’s Computing Department, created LOLCODE as a humorous exploration of what programming would look like in lolspeak. The result was a fully functional language where you greet the interpreter with “HAI” and say goodbye with “KTHXBYE”.
The Lolspeak Connection
LOLCODE keywords directly translate lolspeak expressions to programming concepts:
| Lolspeak | Programming Concept |
|---|---|
| HAI | Program start (like “main”) |
| KTHXBYE | Program end (“OK, thanks, bye”) |
| I HAS A | Variable declaration |
| ITZ | Variable initialization |
| VISIBLE | Print to console |
| GIMMEH | Read input |
| IZ…BIGGER THAN | Greater than comparison |
| O RLY? | If statement (“Oh really?”) |
| YA RLY | Then clause (“Yeah, really”) |
| NO WAI | Else clause (“No way”) |
| IM IN YR | Loop start (“I’m in your…”) |
| IM OUTTA YR | Loop end (“I’m out of your…”) |
Language Features
Despite its humorous nature, LOLCODE is a legitimate programming language with standard features:
Variables and Types
LOLCODE supports several data types:
- YARN - Strings (“balls of yarn”)
- NUMBR - Integers
- NUMBAR - Floating point numbers
- TROOF - Booleans (WIN or FAIL)
- NOOB - Untyped/uninitialized
Control Flow
LOLCODE has conditionals and loops:
O RLY?
YA RLY
VISIBLE "It was true!"
NO WAI
VISIBLE "It was false!"
OIC
Functions
Functions (called “funkshuns”) can be defined:
HOW IZ I SQUARIN YR NUM
FOUND YR PRODUKT OF NUM AN NUM
IF U SAY SO
Implementations
Several LOLCODE interpreters and compilers exist:
lci (LOLCODE Interpreter)
The most complete interpreter, written in C by Justin Meza starting in 2010. It serves as the de facto reference implementation and runs on Windows, macOS, and Linux.
PHP Parser
Jeff Jones created the first LOLCODE parser in PHP, which also powered the first website using LOLCODE as a web scripting language.
.NET Compiler
Nick Johnson created a .NET compiler that was featured at Microsoft’s TechEd 2007 Conference in Australia.
Parrot VM
A LOLCODE compiler was included in the Parrot virtual machine project to demonstrate Parrot’s compiler tools.
Why LOLCODE Matters
Accessible Esoteric Language
Unlike Brainfuck’s minimalism or INTERCAL’s deliberate frustration, LOLCODE is actually readable and approachable. It serves as a gentle introduction to esoteric programming.
Cultural Artifact
LOLCODE is a unique snapshot of 2007 Internet culture - when lolcats were at their peak popularity and meme culture was becoming mainstream.
Educational Value
The humor makes LOLCODE memorable. Learning that I HAS A VAR declares a variable or VISIBLE prints output is entertaining enough that concepts stick.
Demonstration of Language Design
LOLCODE shows that programming languages are ultimately arbitrary - there’s nothing inherently special about print versus VISIBLE or if versus O RLY?. Any consistent syntax can work.
File Extensions
LOLCODE source files typically use:
.lol- Most common.lols- Less common alternative
A Word About the Humor
LOLCODE embraces Internet culture wholeheartedly. If you find lolspeak annoying, you’ll find LOLCODE annoying. But if you appreciate the absurdist humor of cats asking for cheeseburgers, you’ll enjoy writing code that says “HAI” and “KTHXBYE”.
The language doesn’t take itself seriously, and neither should you. It exists to make programmers smile while demonstrating that code can be both functional and fun.
Continue to the Hello World tutorial to write your first LOLCODE program.
Timeline
Notable Uses & Legacy
Esoteric Language Education
Introduces programmers to esoteric languages in a humorous, approachable way.
Programming Humor
Popular for creating amusing code examples and entertaining conference talks.
Internet Culture Studies
Demonstrates how meme culture influenced programming language design.
httpd.lol
Justin Meza created an HTTP server written entirely in LOLCODE.
Language Influence
Influenced By
Running Today
Run examples using the official Docker image:
docker pull esolang/lolcodeExample usage:
docker run --rm -v $(pwd):/code:ro esolang/lolcode lolcode /code/hello.lol