ArticleslgStudy

computer science

Esoteric programming language

Esoteric programming language is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Esoteric programming language rather than just read about it. In short: An esoteric programming language (sometimes shortened to esolang) or weird language 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 th…

Esoteric programming language — main illustration
Esoteric programming language — illustration

Key takeaways

  • Esoteric programming language belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Esoteric programming language to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Esoteric programming language from memory before moving on to harder problems.

Reference excerpt

An esoteric programming language (sometimes shortened to esolang) or weird language 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 live visualization of code, have inspired practical applications in the arts. Such languages are often popular among hackers, hobbyists, and computer science academics. 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.

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, namely FORTRAN, BASIC, COBOL, ALGOL, SNOBOL, SPITBOL, FOCAL, SOLVE, TEACH, APL, LISP, and PL/I. It parodied elements of established programming languages of the day. 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.

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 and similar languages, use single characters as commands, however, it is not uncommon for languages to read line by line like conventional programming languages.

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 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 and Shakespeare, utilize one or more stacks to hold data, leading to a manner of execution akin to Reverse 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 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 achieves this by making all programs resemble Shakespearean plays. Chef 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 a double meaning; this is called multicoding. Multicoding esolangs where the two readings of the code aesthetically impact each other have been compared to the constraint-based writing of the Oulipo movement.

Difficulty to read and write Many esoteric programming languages are designed to produce code that is deeply obfuscated, 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 for instance was explicitly designed to be challenging, and so it has features like self-modifying code 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. 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 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

… excerpt ends here. Continue reading the full article.

Illustrations

Esoteric programming language: A "Hello World" program in Piet
A "Hello World" program in Piet
Esoteric programming language: Whitespace hello world program with syntax highlighting .mw-parser-output .legend{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .legend-color{display:inline-block;min-width:1.25em;height:1.25em;line-height:1.25;margin:1px 0;text-align:center;border:1px solid black;background-color:transparent;color:black}.mw-parser-output .legend-text{}  tabs   spaces
Whitespace hello world program with syntax highlighting .mw-parser-output .legend{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .legend-color{display:inline-block;min-width:1.25em;height:1.25em;line-height:1.25;margin:1px 0;text-align:center;border:1px solid black;background-color:transparent;color:black}.mw-parser-output .legend-text{}  tabs   spaces

Worked examples

Example 1 — a first encounter with Esoteric programming language

Start with the simplest possible case. Write down what Esoteric programming language claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Esoteric programming language before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Esoteric programming language ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Esoteric programming language

In research
Esoteric programming language appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Esoteric programming language in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Esoteric programming language is common in secondary-school and first-year university syllabi. It links to neighbouring topics Computer humour, Esoteric programming languages, Programming language classification, so understanding it makes those chapters shorter.
In everyday life
Look for Esoteric programming language outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Esoteric programming language” →

How to study Esoteric programming language in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Esoteric programming language means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Esoteric programming language out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Esoteric programming language in simple terms?

An esoteric programming language (sometimes shortened to esolang) or weird language 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 programmi…

Why does Esoteric programming language matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Esoteric programming language?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Esoteric programming language.

Tags

  • Computer humour
  • Esoteric programming languages
  • Programming language classification

Keep exploring