A surprising number of programming languages were created to accomplish unusual tasks that have nothing to do with programming. These are commonly called esoteric. Today, weâre going to paint a general overview of the esolang landscape, and try to figure out why people are continuing to create them.
Markus Spiske PD
Esoteric languages combine mainstream programming conventions and things you wouldnât typically associate with computer science â like modern art and humour. According to Federico Tomasetti, a professional language engineer, the purpose of esoteric languages is to upset peopleâs expectations, and force IT professionals to think critically of the tools theyâre used to. This effect can be achieved by a number of things: from simply being weird to elaborately provoking an emotional response.
Letâs take a look at the kinds of challenges esoteric languages pose, and try to categorize them.
The most obvious way to categorize esoteric languages is by their Turing-completeness â ability to express algebraic functions. A great example of a Turing-complete esoteric language is INTERCAL, described by its maintainer Eric S. Raymond as âfundamentally unlike any existing languageâ. Raymond claims that his creation is capable of âreducing strong men to tears (of laughter)â, and is of interest to self-professed âtechnomasochistsâ. Despite the seeming lack of seriousness, INTERCAL is not only viable, but even influential. Its thought-provoking qualities inspired an entire generation of esoteric programming languages.
On the other side of the spectrum are Turing-incomplete languages, like HQ9+. This joke language was designed to only perform four tasks, commonly tackled by novice programmers. The H keyword performs the âHello Worldâ routine. The Q (quine) keyword outputs the programâs source code. The + keyword increases the accumulator variable by one, and the 9 keyword outputs the lyrics to the song â99 Bottles of Beerâ.
Turing-completeness, or lack thereof, is not an indicator of usability in and of itself. Turing-complete esoteric languages frequently become so-called âTuring tarpitsâ thanks to their dysfunctional syntax. Theoretically, they are capable of completing a wide range of tasks, but, in practice, they make writing complicated code next to impossible. To understand how hard even the simplest tasks can get, letâs look at a simple âHello, worldâ script, written in Brainfuck â one of the most infamous esoteric languages in existence:
Federico Tomasetti groups esoteric languages by purpose, such as:
1. Languages that were designed to perform a specific task. These might be quite niche, but nonetheless valuable. For example, the Turing-complete Thue meta-language, named after the famous Norwegian mathematician, is used to define and recognize Type-0 languages from the Chomsky grammar hierarchy.
2. Black box languages. Some languages are made to be intentionally unintelligible â to mislead and confuse outsiders. Such is Malbolge, the language named after the 8th circle of hell in Danteâs Inferno â home to fraudsters and speculators. The quine program in Malbolge is 59 thousand characters long, and was first successfully created only 14 years into the languageâs existence. To an uninitiated reader, its source code looks like a random set of letters and special characters.
3. Proof-of-concept languages. Some things have to be done just to show that you can. Programming languages are no exception. Such is the Befunge family of multi-dimensional languages, created to play around with execution order and push compilers to their limits.
Esoteric programming languages often reflect personal interests of their creators.
1. Film. One of the most popular esoteric languages inspired by film is varâaq. This Klingon-influenced esolang was introduced by Brian Connors, a hardcore âStar Trekâ fan. According to the creator, the name âvarâaqâ doesnât mean anything in Klingon, but sounds like it might belong to a famous mathematician (like Pascal). The syntax of the language, Brian claims, inspires a Klingon-like approach to programming. Other film-inspired esolangs include ArnoldC â a programming language with keywords borrowed from Arnold Schwarzenegger quotes, and Groot, a language where all the commands are variations of the âI am grootâ sentence.
2. Literature . A number of esoteric programming languages are inspired by literature. For example, Shakespeare â the language created by Karl Hasselström and Jon à slund while they were studying syntax analysis. They were vaguely familiar with other esoteric languages and decided to build one of their own as a research project. The end result was capable of transforming any algorithm into a short Shakespearean-style play, with dramatic characters exchanging snide remarks. Every program is structured like an actual stage play: it is divided into multiple acts and scenes. Hereâs an excerpt from the first act of a simple âHello Worldâ script, guaranteed to make Shakespeare roll in his grave:
emeraldschell
3. Visual art . Perhaps, the most famous esoteric language inspired by visual art is Piet, named after the Dutch abstract painter Piet Mondrian. It does away with written language, and requires programmers to imagine their creations as abstract pixel art. The functionality of the program is determined by the shapes and colours of the programmerâs drawing. The end result, in many cases, resembles the works of the languageâs namesake.
Other art-inspired esoteric languages include Matisse (a color-coded Brainfuck modification) and Magritte, the language with only one possible program. âThe Treachery of Imagesâ, Rene Magritteâs famous painting of a pipe, features the phrase âCeci n'est pas une pipeâ (âThis is not a pipeâ). The only statement you can write using Magritte-the language is the similarly brain-wrecking âThis is not a programâ. Of course, itâs not: weâre looking at the source code.
Some esoteric languages have no use apart from their comedic value. These can be separated into a category of their own. The esolang wiki lists more than 130 such languages. Examples include: the cheese-inspired Cheese family of languages (complete with Cheese, Cheese+ and Cheese++), and TURKEY BOMB, the worldâs first programming language that is also a drinking game.
But it doesnât have to be one way or the other â most esoteric languages do not take themselves seriously, regardless of their usefulness. For example, INTERCALâs documentation is riddled with jokes. The introduction to the manual humorously notes that âany resemblance of the programming language portrayed here to other programming languages, living or dead, is purely coincidental.â
Esoteric languages were meant to destroy boxes and shatter preconceptions, so itâs no wonder that theyâre so hard to categorize. In the second part of this essay, weâre going to delve even further into the esolang scene, and talk about the users of these bizarre languages.
Further reading:
Inside ITMO University:
Markus Spiske PD
Esoteric languages combine mainstream programming conventions and things you wouldnât typically associate with computer science â like modern art and humour. According to Federico Tomasetti, a professional language engineer, the purpose of esoteric languages is to upset peopleâs expectations, and force IT professionals to think critically of the tools theyâre used to. This effect can be achieved by a number of things: from simply being weird to elaborately provoking an emotional response.
Letâs take a look at the kinds of challenges esoteric languages pose, and try to categorize them.
Criterion 1: Turing-completeness
The most obvious way to categorize esoteric languages is by their Turing-completeness â ability to express algebraic functions. A great example of a Turing-complete esoteric language is INTERCAL, described by its maintainer Eric S. Raymond as âfundamentally unlike any existing languageâ. Raymond claims that his creation is capable of âreducing strong men to tears (of laughter)â, and is of interest to self-professed âtechnomasochistsâ. Despite the seeming lack of seriousness, INTERCAL is not only viable, but even influential. Its thought-provoking qualities inspired an entire generation of esoteric programming languages.
On the other side of the spectrum are Turing-incomplete languages, like HQ9+. This joke language was designed to only perform four tasks, commonly tackled by novice programmers. The H keyword performs the âHello Worldâ routine. The Q (quine) keyword outputs the programâs source code. The + keyword increases the accumulator variable by one, and the 9 keyword outputs the lyrics to the song â99 Bottles of Beerâ.
Turing-completeness, or lack thereof, is not an indicator of usability in and of itself. Turing-complete esoteric languages frequently become so-called âTuring tarpitsâ thanks to their dysfunctional syntax. Theoretically, they are capable of completing a wide range of tasks, but, in practice, they make writing complicated code next to impossible. To understand how hard even the simplest tasks can get, letâs look at a simple âHello, worldâ script, written in Brainfuck â one of the most infamous esoteric languages in existence:
+++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++.+++++++++++++++++
++++++++++++.+++++++..+++.-------------------
---------------------------------------------
---------------.+++++++++++++++++++++++++++++
++++++++++++++++++++++++++.++++++++++++++++++
++++++.+++.------.--------.------------------
---------------------------------------------
----.-----------------------.
Criterion 2: Purpose
Federico Tomasetti groups esoteric languages by purpose, such as:
1. Languages that were designed to perform a specific task. These might be quite niche, but nonetheless valuable. For example, the Turing-complete Thue meta-language, named after the famous Norwegian mathematician, is used to define and recognize Type-0 languages from the Chomsky grammar hierarchy.
2. Black box languages. Some languages are made to be intentionally unintelligible â to mislead and confuse outsiders. Such is Malbolge, the language named after the 8th circle of hell in Danteâs Inferno â home to fraudsters and speculators. The quine program in Malbolge is 59 thousand characters long, and was first successfully created only 14 years into the languageâs existence. To an uninitiated reader, its source code looks like a random set of letters and special characters.
But not all black box languages are that cruel. Case in point: the BANCStar programming language. While unintelligible to outsiders, BANCStar was developed for commercial purposes and has seen actual use. Despite its complicated syntax, which only consists of digits and commas, it was used to create a total of around 1350 programs. The intentional unintelligibility of the source code served to protect sensitive financial information the language was used to process.
3. Proof-of-concept languages. Some things have to be done just to show that you can. Programming languages are no exception. Such is the Befunge family of multi-dimensional languages, created to play around with execution order and push compilers to their limits.
Criterion 3: Inspiration source
Esoteric programming languages often reflect personal interests of their creators.
1. Film. One of the most popular esoteric languages inspired by film is varâaq. This Klingon-influenced esolang was introduced by Brian Connors, a hardcore âStar Trekâ fan. According to the creator, the name âvarâaqâ doesnât mean anything in Klingon, but sounds like it might belong to a famous mathematician (like Pascal). The syntax of the language, Brian claims, inspires a Klingon-like approach to programming. Other film-inspired esolangs include ArnoldC â a programming language with keywords borrowed from Arnold Schwarzenegger quotes, and Groot, a language where all the commands are variations of the âI am grootâ sentence.
2. Literature . A number of esoteric programming languages are inspired by literature. For example, Shakespeare â the language created by Karl Hasselström and Jon à slund while they were studying syntax analysis. They were vaguely familiar with other esoteric languages and decided to build one of their own as a research project. The end result was capable of transforming any algorithm into a short Shakespearean-style play, with dramatic characters exchanging snide remarks. Every program is structured like an actual stage play: it is divided into multiple acts and scenes. Hereâs an excerpt from the first act of a simple âHello Worldâ script, guaranteed to make Shakespeare roll in his grave:
The Infamous Hello World Program.
Â
Romeo, a young man with a remarkable patience.
Juliet, a likewise young woman of remarkable grace.
Ophelia, a remarkable woman much in dispute with Hamlet.
Hamlet, the flatterer of Andersen Insulting A/S.
Â
Act I: Hamlet's insults and flattery.
Â
Scene I: The insulting of Romeo.
Â
[Enter Hamlet and Romeo]
Â
Hamlet:
You lying stupid fatherless big smelly half-witted coward!
You are as stupid as the difference between a handsome rich brave
hero and thyself! Speak your mind!
Â
You are as brave as the sum of your fat little stuffed misused dusty
old rotten codpiece and a beautiful fair warm peaceful sunny summer's
day. You are as healthy as the difference between the sum of the
sweetest reddest rose and my father and yourself! Speak your mind!
Â
You are as cowardly as the sum of yourself and the difference
between a big mighty proud kingdom and a horse. Speak your mind.
Â
Speak your mind!
Â
[Exit Romeo]
emeraldschell
3. Visual art . Perhaps, the most famous esoteric language inspired by visual art is Piet, named after the Dutch abstract painter Piet Mondrian. It does away with written language, and requires programmers to imagine their creations as abstract pixel art. The functionality of the program is determined by the shapes and colours of the programmerâs drawing. The end result, in many cases, resembles the works of the languageâs namesake.
Other art-inspired esoteric languages include Matisse (a color-coded Brainfuck modification) and Magritte, the language with only one possible program. âThe Treachery of Imagesâ, Rene Magritteâs famous painting of a pipe, features the phrase âCeci n'est pas une pipeâ (âThis is not a pipeâ). The only statement you can write using Magritte-the language is the similarly brain-wrecking âThis is not a programâ. Of course, itâs not: weâre looking at the source code.
Criterion 4: Comedic value
Some esoteric languages have no use apart from their comedic value. These can be separated into a category of their own. The esolang wiki lists more than 130 such languages. Examples include: the cheese-inspired Cheese family of languages (complete with Cheese, Cheese+ and Cheese++), and TURKEY BOMB, the worldâs first programming language that is also a drinking game.
But it doesnât have to be one way or the other â most esoteric languages do not take themselves seriously, regardless of their usefulness. For example, INTERCALâs documentation is riddled with jokes. The introduction to the manual humorously notes that âany resemblance of the programming language portrayed here to other programming languages, living or dead, is purely coincidental.â
Esoteric languages were meant to destroy boxes and shatter preconceptions, so itâs no wonder that theyâre so hard to categorize. In the second part of this essay, weâre going to delve even further into the esolang scene, and talk about the users of these bizarre languages.
Further reading:
- Quantum communications: building 100% secure data transfer systems
- GoROBO: an educational initiative from the ITMO University startup accelerator
- ITMO University startup accelerator introduces Laeneco, a smart stethoscope
- ITMO startups: machine vision edition
Inside ITMO University:
- The cyber-physical systems lab
- ITMO startups: machine vision edition
- Functional Materials and Devices of Optoelectronics
- A tour of the Museum of Optics
- The robotics lab