esolang

Omgrofl

A small structured language whose keywords are internet slang, and whose variables are all spelled lol.

Juraj Borza, 2006 · Turing complete: yes · ●○○ easy · esolangs.org

Tested with 3 known programs · Test method

Run it

Expected: hi

The idea

Juraj Borza made Omgrofl in 2006. The name joins two slang words, omg and rofl. Every keyword is slang: rofl prints, stfw reads, tldr breaks out of a loop, stfu exits.

Read the story

Under the joke it is an ordinary little language. It has byte variables, an if, two kinds of loop and a deque that works as both a stack and a queue. The only rule for a variable name is that it is lol with some number of os: lol, lool, loool. Long programs end up with names like looooooooool, and counting the os is the real puzzle.

The machine

Byte variables (all start at 0, values wrap mod 256) and one deque. One statement per line; case does not matter.

StatementDoes
x iz yAssign; x to /dev/null sets x to 0
lmao x, roflmao xAdd 1, subtract 1
rofl x, stfw xPrint x as a byte, read a byte into x (0 at end)
n00b xPush x onto the deque
l33t x, haxor xPop from the top, take from the bottom (0 when empty)
wtf x iz [nope] liek\|uber y ... brbRun the block if x = y or x > y (nope negates)
rtfm ... brbLoop forever; tldr breaks out
4 x iz a 2 b ... brbLoop with x from a to b, stepping by 1, b included
stfu, afk x, w00tExit, pause (does nothing here), comment

An unknown statement stops the program.

Example

A cat.

A cat. rtfm starts an endless loop. stfw lol reads a byte, and at the end of input that byte is 0, so wtf ... tldr leaves the loop. Otherwise rofl lol prints it.

Patterns it teaches

Try this

  1. Print Hi with one variable.
  2. Use a 4 loop to print the letters a to z.
  3. Hard: read a line and print it backwards with n00b and l33t.

Further

Queue-based

Stack-based

Write your own in Run Convert a program from Omgrofl

Implementation

JavaScript interpreter, source and command line

A JavaScript interpreter, used in the browser and on the command line. Id: omgrofl.

Command line

shib run omgrofl -e 'rtfm
stfw lol
wtf lol iz liek 0
tldr
brb
rofl lol
brb' --input 'hi'
shib manual omgrofl

Source

Module
langs/stack/ports.js
Interpreter
langs/stack/omgrofl.js

Docs: Kernel instructions · The .shib format · Command line · Adding a language

Source esolangs.org (CC0) · Edit on esolangs.org