Esoteric Programming Languages
   HOME

TheInfoList



OR:

An esoteric programming language (sometimes shortened to esolang) is a
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
designed to test the boundaries of computer programming language design, as a proof of concept, as software art, as a hacking interface to another language (particularly
functional programming In computer science, functional programming is a programming paradigm where programs are constructed by Function application, applying and Function composition (computer science), composing Function (computer science), functions. It is a declarat ...
or
procedural programming Procedural programming is a programming paradigm, classified as imperative programming, that involves implementing the behavior of a computer program as Function (computer programming), procedures (a.k.a. functions, subroutines) that call each o ...
languages), or as a
joke A joke is a display of humour in which words are used within a specific and well-defined narrative structure to make people laugh and is usually not meant to be interpreted literally. It usually takes the form of a story, often with dialogue, ...
. The use of the word ''
esoteric Western esotericism, also known as the Western mystery tradition, is a wide range of loosely related ideas and movements that developed within Western society. These ideas and currents are united since they are largely distinct both from orthod ...
'' distinguishes them from languages that working developers use to write software. The creators of most esolangs do not intend them to be used for mainstream programming, although some esoteric features, such as live visualization of code, have inspired practical applications in the arts. Such languages are often popular among hackers and hobbyists. Usability is rarely a goal for designers of esoteric programming languages; often their design leads to quite the opposite. Their usual aim is to remove or replace conventional language features while still maintaining a language that is
Turing-complete In computability theory, a system of data-manipulation rules (such as a model of computation, a computer's instruction set, a programming language, or a cellular automaton) is said to be Turing-complete or computationally universal if it can be ...
, or even one for which the computational class is unknown.


History

The earliest, and still the canonical example of an esoteric programming language, is INTERCAL, designed in 1972 by Don Woods and James M. Lyon, who said that their intention was to create a programming language unlike any with which they were familiar. It parodied elements of established programming languages of the day such as Fortran,
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily ...
and
assembly language In computing, assembly language (alternatively assembler language or symbolic machine code), often referred to simply as assembly and commonly abbreviated as ASM or asm, is any low-level programming language with a very strong correspondence bet ...
. For many years, INTERCAL was represented only by paper copies of the INTERCAL manual. Its revival in 1990 as an implementation in C under
Unix Unix (, ; trademarked as UNIX) is a family of multitasking, multi-user computer operating systems that derive from the original AT&T Unix, whose development started in 1969 at the Bell Labs research center by Ken Thompson, Dennis Ritchie, a ...
stimulated a wave of interest in the intentional design of esoteric computer languages. In 1993, Wouter van Oortmerssen created FALSE, a small stack-oriented programming language with syntax designed to make the code inherently obfuscated, confusing and unreadable. Its compiler is only 1024 bytes in size. This inspired Urban Müller to create an even smaller language, the now-infamous Brainfuck, which consists of only eight recognized characters. Along with Chris Pressey's
Befunge Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, ri ...
(like FALSE, but with a two-dimensional instruction pointer), Brainfuck is now one of the best-supported esoteric programming languages, with canonical examples of minimal Turing tarpits and needlessly obfuscated language features. Brainfuck is related to the P′′ family of
Turing machine A Turing machine is a mathematical model of computation describing an abstract machine that manipulates symbols on a strip of tape according to a table of rules. Despite the model's simplicity, it is capable of implementing any computer algori ...
s.


Common features

While esoteric programming languages differ in many ways, there are some common traits that characterize many languages, such as parody, minimalism, and the goal of making programming difficult. Many esoteric programming languages, such as
brainfuck Brainfuck is an esoteric programming language created in 1993 by Swiss student Urban Müller. Designed to be extremely minimalistic, the language consists of only eight simple commands, a data pointer, and an instruction pointer. Brainfuck is ...
, and similar, use single characters as commands, however, it is not uncommon for languages to read line by line like conventional
programming language A programming language is a system of notation for writing computer programs. Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
s.


Unique data representations

Conventional imperative programming languages typically allow data to be stored in variables, but esoteric languages may utilize different methods of storing and accessing data. Languages like Brainfuck and
Malbolge Malbolge () is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's '' Inferno'', the Malebolge. It was specifically designed to be almost impossible to use, via a cou ...
only permit data to be read through a single pointer, which must be moved to a location of interest before data is read. Others, like
Befunge Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, ri ...
and
Shakespeare William Shakespeare ( 23 April 1564 – 23 April 1616) was an English playwright, poet and actor. He is widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist. He is often called England's natio ...
, utilize one or more stacks to hold data, leading to a manner of execution akin to
Reverse Polish notation Reverse Polish notation (RPN), also known as reverse Łukasiewicz notation, Polish postfix notation or simply postfix notation, is a mathematical notation in which operators ''follow'' their operands, in contrast to prefix or Polish notation ...
. Finally, there are languages which explore alternative forms of number representation: the Brainfuck variant Boolfuck only permits operations on single bits, while Malbolge and INTERCAL variant TriINTERCAL replace bits altogether with a base 3 ternary system.


Unique instruction representations

Esoteric languages also showcase unique ways of representing program instructions. Some languages, such as
Befunge Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, ri ...
and Piet, represent programs in two or more dimensions, with program control moving around in multiple possible directions through the program. This differs from conventional languages in which a program is a set of instructions usually encountered in sequence. Other languages modify instructions to appear in an unusual form, often one that can be read by humans with an alternate meaning to the underlying instructions.
Shakespeare William Shakespeare ( 23 April 1564 – 23 April 1616) was an English playwright, poet and actor. He is widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist. He is often called England's natio ...
achieves this by making all programs resemble Shakespearian plays.
Chef A chef is a professional Cook (profession), cook and tradesperson who is proficient in all aspects of outline of food preparation, food preparation, often focusing on a particular cuisine. The word "chef" is derived from the term (), the di ...
achieves the same by having all programs be recipes. Chef is particularly notable in that some have created programs that successfully function both as a program and as a recipe, demonstrating the ability of the language to produce this double meaning.


Difficulty to read and write

Many esoteric programming languages are designed to produce code that is deeply
obfuscated Obfuscation is the obscuring of the intended meaning of communication by making the message difficult to understand, usually with confusing and ambiguous language. The obfuscation might be either unintentional or intentional (although intent u ...
, making it difficult to read and to write. The purpose of this may be to provide an interesting puzzle or challenge for program writers:
Malbolge Malbolge () is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's '' Inferno'', the Malebolge. It was specifically designed to be almost impossible to use, via a cou ...
for instance was explicitly designed to be challenging, and so it has features like
self-modifying code In computer science, self-modifying code (SMC or SMoC) is source code, code that alters its own instruction (computer science), instructions while it is execution (computing), executing – usually to reduce the instruction path length and imp ...
and highly counterintuitive operations. On the other hand, some esoteric languages become difficult to write due to their other design choices. Brainfuck is committed to the idea of a minimalist instruction set, so even though its instructions are straightforward in principle, the code that arises is difficult for a human to read. INTERCAL's difficulty arises as a result of the choice to avoid operations used in any other programming language, which stems from its origin as a parody of other languages.


Parody and spoof

One of the aims of esoteric programming languages is to parody or spoof existing languages and trends in the field of programming. For instance, the first esoteric language INTERCAL began as a spoof of languages used in the 1960s, such as APL, Fortran, and
COBOL COBOL (; an acronym for "common business-oriented language") is a compiled English-like computer programming language designed for business use. It is an imperative, procedural, and, since 2002, object-oriented language. COBOL is primarily ...
. INTERCAL's rules appear to be the inverse of rules in these other languages. However, the subject of parody is not always another established programming language.
Shakespeare William Shakespeare ( 23 April 1564 – 23 April 1616) was an English playwright, poet and actor. He is widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist. He is often called England's natio ...
can be viewed as spoofing the structure of Shakespearean plays, for instance. The language Ook! is a parody of Brainfuck, where Brainfuck's eight commands are replaced by various orangutan sounds like "Ook. Ook?"


Examples


Befunge

Befunge Befunge is a two-dimensional stack-based, reflective, esoteric programming language. It differs from conventional languages in that programs are arranged on a two-dimensional grid. "Arrow" instructions direct the control flow to the left, ri ...
allows the instruction pointer to roam in multiple dimensions through the code. For example, the following program displays "Hello World" by pushing the characters in reverse order onto the stack, then printing the characters in a loop which circulates clockwise through the instructions , , , , , and . There are many versions of Befunge, the most common being Befunge-93, named as such because of its release year.


Binary lambda calculus

Binary lambda calculus is designed from an algorithmic information theory perspective to allow for the densest possible code with the most minimal means, featuring a 29-byte self interpreter, a 21-byte prime number sieve, and a 112-byte Brainfuck interpreter.


Brainfuck

Brainfuck is designed for extreme minimalism and leads to obfuscated code, with programs containing only eight distinct characters. The following program outputs "Hello, world!": ++++++++++ +++++++>++++++++++>+++<<<-++.>+.+++++++ ..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+. All characters other than are ignored.


Chicken

Chicken has just three tokens, the word "chicken", " " (the space character), and the newline character. The compiler interprets the number of "chickens" on a line as an opcode instruction which it uses to manipulate data on a stack. A simple chicken program can contain dozens of lines with nothing but the word "chicken" repeated countless times. Chicken was invented by Torbjörn Söderstedt who drew his inspiration for the language from a parody of a scientific dissertation.


Chef

Chef is a stack-oriented programming language created by David Morgan-Mar, designed to make programs look like cooking recipes. Programs consist of a title, a list of variables and their data values, and a list of stack manipulation instructions. A joking design principle states that "program recipes should not only generate valid output, but be easy to prepare and delicious", and Morgan-Mar notes that an example
"Hello, World!" program A "Hello, World!" program is usually a simple computer program that emits (or displays) to the screen (often the Console application, console) a message similar to "Hello, World!". A small piece of code in most general-purpose programming languag ...
with 101 eggs and oil would produce "a lot of food for one person."


FRACTRAN

A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input n. The program is run by multiplying the integer n by the first fraction f in the list for which nf is an integer. The integer n is then replaced by nf and the rule is repeated. If no fraction in the list produces an integer when multiplied by n, the program halts. FRACTRAN was invented by mathematician
John Conway John Horton Conway (26 December 1937 – 11 April 2020) was an English mathematician. He was active in the theory of finite groups, knot theory, number theory, combinatorial game theory and coding theory. He also made contributions to many br ...
.


GolfScript

Programs in GolfScript, a language created for
code golf Code golf is a type of recreational computer programming competition in which participants strive to achieve the shortest possible source code that solves a certain problem. Code golf challenges and tournaments may also be named with the programmi ...
, consist of lists of items, each of which is pushed onto the
stack Stack may refer to: Places * Stack Island, an island game reserve in Bass Strait, south-eastern Australia, in Tasmania’s Hunter Island Group * Blue Stack Mountains, in Co. Donegal, Ireland People * Stack (surname) (including a list of people ...
as it is encountered, with the exception of variables which have code blocks as their value, in which case the code is executed.


INTERCAL

INTERCAL, short for "Compiler Language With No Pronounceable Acronym", was created in 1972 as a parody to satirize aspects of the various programming languages at the time.


JSFuck

JSFuck JSFuck is an esoteric subset of JavaScript, where code is written using only six characters: , ">/code>, /code>, (, ), !, and +. The name is derived from Brainfuck, an esoteric programming language that also uses a minimalistic alphabet of only ...
is an esoteric programming style of
JavaScript JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior. Web browsers have ...
, where code is written using only six characters: /code>, /code>, (, ), !, and +. Unlike Brainfuck, which requires its own compiler or interpreter, JSFuck is valid JavaScript code, meaning JSFuck programs can be run in any
web browser A web browser, often shortened to browser, is an application for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's scr ...
or engine that interprets JavaScript. It has been used in a number of
cross-site scripting Cross-site scripting (XSS) is a type of security vulnerability that can be found in some web applications. XSS attacks enable attackers to inject client-side scripts into web pages viewed by other users. A cross-site scripting vulnerability may be ...
(XSS) attacks on websites such as
eBay eBay Inc. ( , often stylized as ebay) is an American multinational e-commerce company based in San Jose, California, that allows users to buy or view items via retail sales through online marketplaces and websites in 190 markets worldwide. ...
due to its ability to evade cross-site scripting detection filters.


LOLCODE

LOLCODE is designed to resemble the speech of
lolcat A lolcat (pronounced ), or LOLcat, is an image macro of one or more cats. Lolcat images' Idiosyncrasy, idiosyncratic and intentionally grammatically incorrect text is known as lolspeak. Lolcat is a Compound (linguistics), compound word of the ...
s. The following is the "Hello World" example:
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
While the
semantics Semantics is the study of linguistic Meaning (philosophy), meaning. It examines what meaning is, how words get their meaning, and how the meaning of a complex expression depends on its parts. Part of this process involves the distinction betwee ...
of LOLCODE is not unusual, its syntax has been described as a
linguistic Linguistics is the scientific study of language. The areas of linguistic analysis are syntax (rules governing the structure of sentences), semantics (meaning), Morphology (linguistics), morphology (structure of words), phonetics (speech sounds ...
phenomenon, representing an unusual example of informal speech and internet slang in programming.


Malbolge

Malbolge Malbolge () is a public domain esoteric programming language invented by Ben Olmstead in 1998, named after the eighth circle of hell in Dante's '' Inferno'', the Malebolge. It was specifically designed to be almost impossible to use, via a cou ...
(named after the 8th circle of Hell) was designed to be the most difficult and esoteric programming language. Among other features, code is self-modifying by design and the effect of an instruction depends on its address in memory.


Minecraft

Minecraft ''Minecraft'' is a 2011 sandbox game developed and published by the Swedish video game developer Mojang Studios. Originally created by Markus Persson, Markus "Notch" Persson using the Java (programming language), Java programming language, the ...
is a
sandbox game A sandbox game is a video game with a gameplay element that provides players a great degree of creativity to interact with, usually without any predetermined goal, or with a goal that the players set for themselves. Such games may lack any objec ...
developed by Mojang Studios, which contains a turing-complete redstone system for logical processing. It can be considered a three-dimensional esolang.


Piet

Piet is a language designed by David Morgan-Mar, whose programs are
bitmap In computing, a bitmap (also called raster) graphic is an image formed from rows of different colored pixels. A GIF is an example of a graphics image file that uses a bitmap. As a noun, the term "bitmap" is very often used to refer to a partic ...
s that look like
abstract art Abstract art uses visual language of shape, form, color and line to create a Composition (visual arts), composition which may exist with a degree of independence from visual references in the world. ''Abstract art'', ''non-figurative art'', ''non- ...
. The execution is guided by a "pointer" that moves around the image, from one continuous coloured region to the next. Procedures are carried out when the pointer exits a region. There are 20 colours for which behaviour is specified: 18 "colourful" colours, 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 "colourful" colour 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. Regions outside the borders of the image are also treated as black. White does not perform operations, but allows the pointer to "pass through". The behaviour of colours other than the 20 specified is left to the compiler or interpreter. Variables are stored in memory as signed integers in a single
stack Stack may refer to: Places * Stack Island, an island game reserve in Bass Strait, south-eastern Australia, in Tasmania’s Hunter Island Group * Blue Stack Mountains, in Co. Donegal, Ireland People * Stack (surname) (including a list of people ...
. Most specified procedures deal with operations on that stack, while others deal with input/output and with the rules by which the compilation pointer moves. Piet was named after the Dutch painter
Piet Mondrian Pieter Cornelis Mondriaan (; 7 March 1872 – 1 February 1944), known after 1911 as Piet Mondrian (, , ), was a Dutch Painting, painter and Theory of art, art theoretician who is regarded as one of the greatest artists of the 20th century. He w ...
. The original intended name, ''Mondrian'', was already taken by an open-source statistical data-visualization system.


Shakespeare

Shakespeare Programming Language The Shakespeare Programming Language (SPL) is an esoteric programming language designed by Jon Åslund and Karl Wiberg. Like the Chef programming language, it is designed to make programs appear to be something other than programs — in this cas ...
(SPL) is designed to make programs look like
Shakespearean William Shakespeare ( 23 April 1564 – 23 April 1616) was an English playwright, poet and actor. He is widely regarded as the greatest writer in the English language and the world's pre-eminent dramatist. He is often called England's nation ...
plays. For example, the following statement declares a point in the program which can be reached via a GOTO-type statement: Act I: Hamlet's insults and flattery.


Unlambda

Unlambda Unlambda is a minimal, "nearly pure" functional programming language invented by David Madore. It is based on combinatory logic, an expression system without the lambda operator or free variables. It relies mainly on two built-in functions (s ...
is a minimalist functional programming language based on SKI calculus, but combined with first-class
continuation In computer science, a continuation is an abstract representation of the control state of a computer program. A continuation implements ( reifies) the program control state, i.e. the continuation is a data structure that represents the computat ...
s and imperative I/O (with input usually requiring the use of continuations).


Whitespace

Whitespace White space or whitespace may refer to: Technology * Whitespace characters, characters in computing that represent horizontal or vertical space * White spaces (radio), allocated but locally unused radio frequencies * TV White Space Database, a m ...
uses only whitespace characters (space, tab, and return), ignoring all other characters, which can therefore be used for comments. This is the reverse of many traditional languages, which do not distinguish between different whitespace characters, treating tab and space the same. It also allows Whitespace programs to be hidden in the source code of programs in languages like C.


AmitabhC

AmitabhC is designed to resemble
Bollywood Hindi cinema, popularly known as Bollywood and formerly as Bombay cinema, is primarily produced in Mumbai. The popular term Bollywood is a portmanteau of "Bombay" (former name of Mumbai) and "Cinema of the United States, Hollywood". The in ...
cinema dialogue and references from legendary actor
Amitabh Bachchan Amitabh Bachchan (; 11 October 1942) is an Indian actor who works in Hindi cinema. He is often considered one of the greatest, most accomplished and commercially successful actors in the history of Indian cinema.* * * * * With a cinemati ...
's films. Programs are structured like film productions with LIGHTS, CAMERA, and ACTION blocks, while incorporating interactive elements inspired by the game show "
Kaun Banega Crorepati ''Kaun Banega Crorepati'' (simply ''KBC''; English: ''Who Will Become a Crorepati'') is an Indian Hindi-language television game show. It is the official Hindi adaptation of the '' Who Wants to Be a Millionaire?'' franchise. It is presented ...
" including PHONE_A_FRIEND and AUDIENCE_POLL commands. The following is the "Hello World" example:
LIGHTS
CAMERA
DEVIYON_AUR_SAJJANO
VIJAY name = "Amitabh Bachchan"
BOLO "Namaste! Main hoon AmitabhC!"
ACTION
The language uses
Hindi Modern Standard Hindi (, ), commonly referred to as Hindi, is the Standard language, standardised variety of the Hindustani language written in the Devanagari script. It is an official language of India, official language of the Government ...
phrases for common programming constructs: DEVIYON_AUR_SAJJANO (Ladies and Gentlemen) begins programs, BOLO serves as the print statement, VIJAY and DON declare variables referencing Bachchan's iconic film characters, and AGAR implements conditional logic. AmitabhC represents a cultural parody approach to esoteric programming, making coding accessible through familiar
Indian cinema The cinema of India, consisting of motion pictures made by the Indian film industry, has had a large effect on world cinema since the second half of the 20th century. Indian cinema is made up of various film industries, each focused on p ...
references while maintaining enterprise-grade security features.


Cultural context

The cultural context of esolangs has been studied by Geoff Cox, who writes that esolangs "shift attention from command and control toward cultural expression and refusal", seeing esolangs as similar to code art and code poetry, such as Mez Breeze's mezangelle, a belief shared by others in field. Daniel Temkin claims that "esolangs are open-ended systems, natively collaborative, and distanced from any single materialized form," which "challenge or re-affirm wider ideas in programming culture and in how computer science is taught," including the neutral, "professional" style advocated in Edsgar Dijkstra's ''The Humble Programmer''.


References


Bibliography

* * *


External links


Esolang, the esoteric programming languages wiki
{{DEFAULTSORT:Esoteric Programming Language Programming language classification Computer humour