An esoteric programming language (sometimes shortened to esolang) is a programming language 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 or procedural programming languages), or as a joke. The use of the word esoteric 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 visuospatial syntax, 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, or even one for which the computational class is unknown.
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 and assembly language.
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 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 (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 machines.
Befunge 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
"dlroW olleH">:v ^,_@
There are many versions of Befunge, the most common being Befunge-93.
Binary lambda calculusEdit
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.
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 with "101 eggs" and "111 cups oil" would produce "a lot of food for one person."
A FRACTRAN program is an ordered list of positive fractions together with an initial positive integer input . The program is run by multiplying the integer by the first fraction in the list for which is an integer. The integer is then replaced by and the rule is repeated. If no fraction in the list produces an integer when multiplied by , the program halts. FRACTRAN was invented by mathematician John Conway.
Programs in GolfScript consist of lists of items, each of which is pushed onto the stack as it is encountered, with the exception of variables which have code blocks as their value, in which case the code is executed.
HAI CAN HAS STDIO? VISIBLE "HAI WORLD!" KTHXBYE
LOLCODE is frequently criticized for not being very esoteric, but rather being an ordinary procedural language with an unusual vocabulary.
Malbolge (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.
Piet is a language designed by David Morgan-Mar, whose programs are bitmaps that look like abstract art. 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.[non-primary source needed]
Variables are stored in memory as signed integers in a single stack. 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. The original intended name, Mondrian, was already taken by an open-source statistical data-visualization system.
Shakespeare is designed to make programs look like Shakespearean plays. For example, the following statement declares a point in the program which can be reached via a GOTO-type statement:
Unlambda is a minimalist functional programming language based on SKI calculus, but combined with first-class continuations and imperative I/O (with input usually requiring the use of continuations).
Whitespace 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.
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. Daniel Temkin describes Brainfuck as "refusing to ease the boundary between human expression and assembly code and thereby taking us on a ludicrous journey of logic," exposing the inherent conflict between human thinking and computer logic. He connects programming within an esolang to performing an event score such as those of the Fluxus movement, where playing out the rules of the logic in code makes the point of view of the language clear.
- McLean, A., Griffiths, D., Collins, N., and Wiggins, G. (2010). "Visualisation of Live Code". In Electronic Visualisation and the Arts, London: 2010.
- Matthew Fuller, Software Studies, MIT Press, 2008
- Eric S. Raymond (1996). The New Hacker's Dictionary. MIT Press. p. 258. ISBN 978-0-262-68092-9.
- Woods, Donald R.; Lyon, James M. (1973), The INTERCAL Programming Language Reference Manual, Muppetlabs.com, archived from the original on 20 February 2009, retrieved 24 April 2009
- "Interview with Wouter van Oortmerssen". Esoteric.codes. 1 July 2015. Archived from the original on 8 December 2015. Retrieved 1 December 2015.
- Cozens, Simon (2005). Advanced Perl programming. O'Reilly Media. p. 269. ISBN 978-0-596-00456-9.
A final Acme curiosity, and one of my favourites, is Acme: :Chef, an implementation of David Morgan-Mar's Chef programming language. In Chef, programs are expressed in the form of recipes: ...
- Morgan-Mar, David (24 March 2011). "Chef". DM's Esoteric Programming Languages. Self-published. Retrieved 28 June 2014.
- Morgan-Mar, David (28 June 2014). "Chef Sample Program: Hello World Souffle". DM's Esoteric Programming Languages. Self-published. Retrieved 28 June 2014.
- Bailey, Jane (29 February 2016). "Bidding on Security". The Daily WTF. Retrieved 2 March 2020.
- "Exploring JSF*ck". alligator.io. Retrieved 2 March 2020.
- "LOLCODE#Criticism". Esolangs.org. Retrieved 30 November 2015.
LOLCODE is often criticized for not being Esoteric enough. By design, LOLCODE is actually a normal procedural language behind its lulzy syntax. This is a stark contrast from "True" Esolangs like Befunge, which features a two-dimensional, almost game board-like syntax. For this reason, LOLCODE is technically categorized as a Weirdlang.
- Morgan-Mar, David (25 January 2008). "Piet programming language". Retrieved 18 May 2013.
- Cox 2013, p. 6
- Cox 2013, p. 5
- Temkin, Daniel (15 January 2014). "Glitch && Human/Computer Interaction". NOOART: The Journal of Objectless Art (1).
- Temkin, Daniel. "brainfuck". Media-N Journal (Spring 2013). Retrieved 6 May 2014.
- Camille Paloque-Bergès (2009). "Langages ésotériques". Poétique des codes sur le réseau informatique. Archives contemporaines. ISBN 978-2-914610-70-4.
- Cox, Geoff (2013). Speaking Code: Coding as Aesthetic and Political Expression. MIT Press. ISBN 978-0-262-01836-4.
|Wikimedia Commons has media related to Esoteric programming languages.|
- Obfuscated Programming Languages at Curlie
- Esolang — a wiki devoted to esoteric programming languages