Jump to content

Esoteric programming language

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by RolandIllig (talk | contribs) at 15:20, 19 May 2006 (External links: corrected URL in the text). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

An esoteric programming language (sometimes shortened to esolang) is a programming language designed as a test of the boundaries of computer programming language design, as a proof of concept, or as a joke. There is usually no intention of the language being adopted for real-world programming. Such languages are often popular among hackers and hobbyists. This use of esoteric is meant to distinguish these languages from more popular programming languages. Some more popular languages may appear esoteric (in the usual sense of the word) to some, and though these could arguably be called "esoteric programming languages" too, this is not what is meant.

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. Thus, by adhering to some principles while deliberately making no sense as a whole (or attempting to hide any sense they make to most people), these languages are perhaps the programming equivalent of nonsense verse.

History

The earliest, and still the canonical example of an esoteric language was INTERCAL, designed in 1972 by James Lyons and Don Woods, with the stated intention of being unlike any other programming language the authors were familiar with.

More than twenty years later, Urban Müller created the now-famous brainfuck, which consist of only eight recognized characters. Along with Befunge, brainfuck is now one of the most well-supported esoteric programming languages. These are canonical examples of minimal Turing tarpits and needlessly obfuscated language features; brainfuck's minimality borders on elegant and pure language design.

Esoteric programming terms

A Turing-complete programming language with arbitrarily few commands. These include brainfuck (8 commands, all with 0 operands), OISC (1 command, 3 operands), and Thue (1 command, 2 operands).

The paradigm of a language can fall into a number of categories, and these categories are used to get a general understanding of the way that a specific language operates. These include imperative/despotic languages such as Brainfuck, in which instructions describe how to change data; functional languages such as Unlambda, in which data and code are more or less interchangeable and execution is the repeated application of functions to the results of other functions; and rewriting languages such as Thue, in which transformation functions are applied to an initial state.

Nondeterministic language

A deterministic language is one in which it can always be predicted based on the state of a program what the next state will be. Most languages are deterministic, as nondeterministic languages such as Java2K often give unreliable results, and getting even trivial programs to have a reliable output is often a monumental task. Nondeterministic languages have only a certain probablity (less than 100%) of behaving the way that they are expected to.

Despotic language

A despotic language is a Turing tarpit with a stateful encoding, namely a language in which commands are used to select from a finite range of operations and apply these operations to the current state of the program. Examples include ReMorse and Whirl, and arguably INTERCAL.

Stateful encoding

A system of encoding programs such that each substring of the encoding is an instruction to locate the next instruction in a list. An example based on ReMorse or THRAT would be:

  • Select Next Operation in list
  • Perform Operation

With the list of operations either standard (as in ReMorse or THRAT) or dynamic (as in ReMorse4ever).

Example languages

The canonical esoteric languages are probably INTERCAL, brainfuck, and Befunge.

Internet community

There is a small but thriving community on the Internet of hobbyists who program in and design esoteric programming languages.

The esolang community is active sporadically, and topics of discussion range from debate as to whether a language is Turing-complete to how one would go about representing abstract and hard to visualise mathematical concepts in a programming environment. There is a mailing list, but as of 2005 the mailing list is nearly abandoned and most discussion happens on the wiki (see below).

Turing completeness is a favorite topic of discussion, since it is not immediately obvious whether or not a language is Turing complete, and it often takes rather large intuitive leaps to come to a solution. New languages with new features are always being created, so proof of Turing completeness is always a challenge.

A related pursuit among programming language enthusiasts is the writing of obfuscated code.

See also