Top 10 Truly Bizarre Programming Languages
This is a list of some of the most bizarre programming languages you will ever see. These types of languages are usually called “Esoteric Programming Languages”. An esoteric programming language (sometimes shortened to esolang) is a computer programming language designed either as a test of the boundaries of programming language design, to experiment with weird ideas or simply as a joke, rather than for practical reasons. There is usually no intention of the language being adopted for real-world programming. Such languages are often popular among hackers and hobbyists.
Usability is rarely a high priority for such languages; often quite the opposite. The usual aim is to remove or replace conventional language features while still maintaining a language that is Turing-complete, or even one for which the computational class is unknown.
Many fascinating and unlikely languages have been developed, and there is a small but active Internet community of people creating, programming in and debating them.
A “Hello World” program has traditionally been the first program most people learn in a language that is new to them. It is a (usually) simple piece of code that outputs the words “Hello, World!” on an output device, typically the computer screen.
Please be sure to look at all the example codes – they are, in most instances, quite hilarious.
INTERCAL was created in 1972, thus probably making it the first ever esoteric programming language. Donald R. Woods and James M. Lyon (pictured above) invented it, with the goal of creating a language with no similarities whatsoever to any existing programming languages.
According to the original manual by the authors, “The full name of the compiler is ‘Compiler Language With No Pronounceable Acronym,’ which is, for obvious reasons, abbreviated ‘INTERCAL’.”
Common operations in other languages have cryptic and redundant syntax in INTERCAL. The INTERCAL Reference Manual contains many paradoxical, nonsensical or otherwise humorous instructions, like:
“Caution! Under no circumstances confuse the mesh with the interleave operator, except under confusing circumstances!”
INTERCAL has many other features designed to make it even more aesthetically unpleasing to the programmer: it uses statements such as “IGNORE” and “FORGET”, as well as modifiers such as “PLEASE”. This last keyword provides two reasons for the program’s rejection by the compiler: if “PLEASE” does not appear often enough, the program is considered insufficiently polite, and the error message says so; if too often, the program could be rejected as excessively polite.
As the name suggests, Whitespace, designed in 2002, by Edwin Brady and Chris Morris, is an esoteric programming language that uses only whitespace characters as syntax. Thus, only spaces, tabs and linefeeds have meaning. When it was released on April 1st, 2003, most people took it as an April Fools’ joke, which it wasn’t.
Unlike most programming languages, which ignore or assign little meaning to most whitespace characters, the Whitespace interpreter ignores any non-whitespace characters. An interesting consequence of this property is that a Whitespace program can easily be contained within the whitespace characters of a program written in another language, making the text a polyglot.
Pictured above is “Hello World” in Whitespace.
Chef, designed by David Morgan-Mar in 2002, is an esoteric programming language in which programs look like cooking recipes. The variables tend to be named after basic foodstuffs, the stacks are called “mixing bowls” or “baking dishes” and the instructions for manipulating them “mix”, “stir”, etc. The ingredients in a mixing bowl or baking dish are ordered “like a stack of pancakes”.
According to the Chef Home Page, the design principles for Chef are:
- Program recipes should not only generate valid output, but be easy to prepare and delicious.
- Recipes may appeal to cooks with different budgets.
- Recipes will be metric, but may use traditional cooking measures such as cups and tablespoons.
Velato is a language which uses MIDI files as source code. Programs in Velato are defined by the pitch and order of notes. It is intended to allow for flexibility in composition, so functional programs will not necessarily sound like random notes. There is a tendency for Velato programs to have jazz-like harmonies.
All statements in Velato begin with a “command root” note; intervals from this note are translated into commands and expressions. The command root can be changed between statements, to allow for more musical (or at least less repetitive) progressions.
Of course, like all MIDI files, Velato programs can also be represented as sheet music. Pictured above is sheet music – which you can listen to here.
The Shakespeare Programming Language (SPL) was designed by Jon Åslund and Karl Hasselström. Like Chef (item #8), it is designed to make programs appear to be something other than programs; in this case, Shakespearean plays.
The first line in a Shakespeare program is called the “title” and acts as a comment. The “Dramatis Personae” is the section where variables are declared. Each variable name must be the name of a character from a Shakespeare play.
A piece of code in Shakespeare is broken into “Acts”, which contain “Scenes”, in which characters (variables) interact. Each Act and Scene is numbered with a roman numeral and serves as a GOTO label. They are written in the form:
Act I: Hamlet’s insults and flattery.
Scene I: The insulting of Romeo.
Before “characters” (variables) can “act” (be acted upon) they must first be “on stage”. To call a variable to the stage the “Enter” command is used. To tell characters to leave the stage, use the “Exit” command. “Exeunt” calls more than one character to leave, or in the case that no characters are listed all the characters will leave the stage.
Omgrofl is a language created in 2006 by Juraj Borza. In stark contrast to the previous entry, its keywords resemble Internet slang. The name comes from combining the slang “words” omg and rofl. Rofl is actually one of Omgrofl’s commands. Omgrofl is not case-sensitive, thus lol is the same as LoL. You may use this to produce “nicer” code.
Variables in Omgrofl must be a form of the slang word lol, like lol, lool, loool, looool, etc. A variable can be defined as:
lol iz 4
wtf condition is a conditional statement (like if in C). The statements until the matching brb are executed only if the condition is true.
lol iz 1
wtf lol iz liek 1
Possible conditions are:
iz uber – checks if one expression is greater than another.
iz liek – checks if two expressions are equal.
These may be modified by:
nope – negation (like ! in C) – needs to be placed in front of liek or uber.
x iz nope uber y
lol iz nope liek 7
Other keywords in Omgrofl include: rtfm, tldr, w00t, stfw, n00b, l33t, haxor, stfu (exits application immediately).
Piet is a language whose programs are bitmap graphics that look like abstract art. It was designed by David Morgan-Mar, who also created Chef. It is named after geometric abstract art pioneer, Piet Mondrian; the originally intended name, Mondrian, was already taken.
There are 20 colors for which behavior is specified: 18 “colorful” colors, which are ordered by a 6-step hue cycle and a 3-step brightness cycle; and black and white, which are not ordered. When exiting a “colorful” color and entering another one, the performed procedure is determined by the number of steps of change in hue and brightness. Black cannot be entered; when the pointer tries to enter a black region, the rules of choosing the next block are changed instead. If all possible rules are tried, the program terminates. White does not perform operations, but allows the pointer to “pass through”.
Pictured above is a Piet program that outputs “piet”.
Befunge differs from conventional languages in that programs are arranged on a two-dimensional grid, the playfield. “Arrow” instructions – <, >, ^, and v – direct the control flow to the left, right, up or down, and loops are constructed by sending the control flow in a cycle.
Befunge was invented in 1993, by Chris Pressey, with the goal of being as difficult to compile as possible. This was attempted with the implementation of self-modifying code (the ‘p’ instruction can write new instructions into the playfield) and a multi-dimensional playfield (the same instruction can be executed in four different directions). Nevertheless, a number of compilers have subsequently been written.
Like brainfuck (see item #1), Befunge has spawned many descendants and remote cousins. Befunge-extensions and variants are called Fungeoids or just Funges.
Most one-dimensional programming languages require some syntactic distinction between comment text and source code. In Befunge, there is no comment syntax: to embed documentation in the code, the programmer simply routes the control flow around the “comment” area, so that the text in that area is never executed.
Whereas Befunge is designed to be difficult to compile (translate into machine code), Malbolge, created by Ben Olmstead in 1998, and named after the eighth circle of Hell in Dante’s Inferno, is meant to be as difficult as possible to actually write programs in. It was so difficult to understand when it arrived that it took two years for the first Malbolge program to appear, and even this was not written by a human, but by a Lisp program using a beam search of the space of all possible programs.
There is some discussion about whether one can implement sensible loops in Malbolge – it took many years before the first non-terminating one was introduced. A correct “99 Bottles of Beer” program (with the complete lyrics to the song as its output), which deals with non-trivial loops and conditions, was not announced for eight years; the first correct one was by Hisashi Iizawa, in 2007. It is pictured above.
Brainfuck is the most famous esoteric programming language, and has inspired the creation of a host of other languages. Noted for its extreme minimalism, it is designed to challenge and amuse programmers, and is not suitable for practical use. To avoid offense, its name is sometimes given as b****fuck. The name of the language is generally not capitalized except at the start of a sentence.
Urban Müller created brainfuck in 1993, with the intention of designing a language which could be implemented with the smallest possible compiler. Several brainfuck compilers have been made smaller than 200 bytes.
The language consists of only eight commands: > < + – . , [ ]. A brainfuck program is a sequence of these commands, possibly interspersed with other characters (which are ignored).
As the name suggests, brainfuck programs tend to be difficult to comprehend. This is because any mildly complex task requires a long sequence of commands, which is one of the reasons it is not used for serious programming. Nonetheless, like any Turing-complete language, brainfuck is theoretically capable of computing any computable function, if given access to an unlimited amount of memory.
This list was compiled with the help of the Esolang Wiki and Wikipedia.