Moonythedwarf (talk | contribs) →Esoteric programming terms: snipity snip. No citations Tag: Visual edit |
Moonythedwarf (talk | contribs) snip all the non-notable examples Tag: 2017 wikitext editor |
||
Line 13: | Line 13: | ||
== Examples == |
== Examples == |
||
<!-- Please do ''not'' add the language you just created to this list. Add it to the Esoteric Wiki, https://esolangs.org, instead. Wikipedia is not a place to put whatever language you just invented, and Esolangs is. --> |
<!-- Please do ''not'' add the language you just created to this list. Add it to the Esoteric Wiki, https://esolangs.org, instead. Wikipedia is not a place to put whatever language you just invented, and Esolangs is. --> |
||
Below are some characteristic examples of esoteric programming languages: |
|||
=== ArnoldC === |
|||
ArnoldC is an esoteric programming language based on one-liners of [[Arnold Schwarzenegger]]. Following is the "Hello, World!" programmed in ArnoldC:<syntaxhighlight lang="text"> |
|||
IT'S SHOWTIME |
|||
TALK TO THE HAND "Hello, World!" |
|||
YOU HAVE BEEN TERMINATED |
|||
</syntaxhighlight> |
|||
=== AsciiDots === |
|||
AsciiDots is an esoteric programming language based on ASCII art. In this language, ''dots'', represented by periods (<code>.</code>), travel down ASCII art paths and undergo operations. Here is an example of a [[code golf]] counter:<syntaxhighlight lang="text"> |
|||
/#$<. |
|||
*-[+] |
|||
\#1/ |
|||
</syntaxhighlight> |
|||
=== Befunge === |
=== Befunge === |
||
[[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 <code>></code>, <code>:</code>, <code>v</code>, <code>_</code>, <code>,</code>, and <code>^</code>. |
[[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 <code>></code>, <code>:</code>, <code>v</code>, <code>_</code>, <code>,</code>, and <code>^</code>. |
||
Line 44: | Line 28: | ||
++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++ |
++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++ |
||
..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+. |
..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+. |
||
</syntaxhighlight> |
|||
=== Chef === |
|||
Chef by [[David Morgan-Mar]] is a [[stack-oriented programming language]] designed to make programs look like cooking recipes.<ref>{{cite book|last=Cozens|first=Simon|title=Advanced Perl programming|year=2005|publisher=O'Reilly Media|isbn=978-0-596-00456-9|page=269|quote=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: ...}}</ref> Programs consist of a title, a list of variables and their data values and a list of stack manipulation instructions.<ref name="chef">{{cite web|url=http://www.dangermouse.net/esoteric/chef.html|title=Chef|work=DM's Esoteric Programming Languages|first=David|last=Morgan-Mar|publisher=Self-published|date=2011-03-24|accessdate=2014-06-28}}</ref> 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|Hello World program]] with "101 eggs" and "111 cups oil" would produce "a lot of food for one person."<ref name="chef"/><ref>{{cite web|url=http://www.dangermouse.net/esoteric/chef_hello.html|title=Chef Sample Program: Hello World Souffle|work=DM's Esoteric Programming Languages|first=David|last=Morgan-Mar|publisher=Self-published|date=2014-06-28|accessdate=2014-06-28}}</ref> |
|||
=== FALSE === |
|||
FALSE is a [[stack-based language]] with single-character commands and variables.<ref>{{cite web |url=http://strlen.com/false/ |title=The FALSE Programming Language |last1=van Oortmerssen |first1=Wouter |publisher=Self-published |access-date=11 February 2016}}</ref> For example, 3 + 1 can be calculated by evaluating (λ x → x + 1)(3): |
|||
3[1+]! |
|||
=== FiM++ === |
|||
FiM++ is an [[Object-oriented programming|object-oriented programming language]] based on the [[My Little Pony: Friendship Is Magic|My Little Pony]] television show.<ref>{{Cite web|url=https://www.equestriadaily.com/2012/10/editorial-fim-pony-programming-language.html|title=Editorial: FiM++, A Pony Programming Language|last=Sethisto|website=www.equestriadaily.com|access-date=2018-01-07}}</ref> FiM++ programs read like plain English, in the style of the show's 'friendship reports'. The following program prints "Hello World!"<syntaxhighlight lang="text"> FiM++ supports many modern language features, such as interfaces, inheritance, and importing files. Uniquely, variable names can contain spaces in FiM++. |
|||
Dear Princess Celestia: Hello World! |
|||
Today I learned how to say Hello World! |
|||
I said "Hello World!". |
|||
That's all about how to say Hello World. |
|||
Your faithful student, Twilight Sparkle. |
|||
</syntaxhighlight> |
</syntaxhighlight> |
||
Line 69: | Line 35: | ||
=== GolfScript === |
=== GolfScript === |
||
Programs in [[GolfScript]] consist of lists of items, each of which is pushed onto the [[Stack (abstract data type)|stack]] as it is encountered with the exception of variables which have code blocks as their value, in which case the code is executed. |
Programs in [[GolfScript]] consist of lists of items, each of which is pushed onto the [[Stack (abstract data type)|stack]] as it is encountered with the exception of variables which have code blocks as their value, in which case the code is executed. |
||
=== Grass === |
|||
Grass is a functional programming language that only uses the characters <code>W</code>, <code>w</code>, and <code>v</code>. Thus, programs in Grass are said to look like [[ASCII art]] of grass. Grass has the formal specification which is based on [[untyped lambda calculus]] and the [[SECD machine]].<ref>http://www.blue.sky.or.jp/grass/</ref> Grass should not be confused with [[GRASS_(programming_language)|GRASS]], a different programming language. |
|||
=== INTERCAL === |
=== INTERCAL === |
||
Line 93: | Line 56: | ||
=== Malbolge === |
=== Malbolge === |
||
[[Malbolge]] (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. |
[[Malbolge]] (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. |
||
=== ModiScript === |
|||
[https://github.com/VPanjeta/ModiScript/ ModiScript]<ref>{{Cite web|url=https://github.com/VPanjeta/ModiScript|title=VPanjeta/ModiScript|website=GitHub|language=en|access-date=2018-04-18}}</ref> is an esoteric programming language that entirely consists of quotes from Indian Prime Minister [[Narendra Modi]]'s speeches. The language follows many of his ideologies such as the "No import rule", in which importation of code is not allowed, consistent with his "[[Make in India]]" campaign. |
|||
The following code prints "Mandir Wahin Banayenge": |
|||
<syntaxhighlight lang="text"> |
|||
mitrooon |
|||
UP "BJP governed state hai" |
|||
SP "opposition me hai" |
|||
agar ye sach hai |
|||
bhaiyo aur behno "Mandir wahin banayenge" |
|||
nahi toh |
|||
bhaiyo aur behno "Abhi decision nahi liya gaya hai" |
|||
achhe din aa gaye |
|||
</syntaxhighlight> |
|||
=== Piet === |
=== Piet === |
||
Line 126: | Line 75: | ||
Piet was named after the Dutch painter [[Piet Mondrian]].<ref name="Cox2013">{{harvnb|Cox|2013|p=6}}</ref> The originally intended name, ''Mondrian'', was already taken. |
Piet was named after the Dutch painter [[Piet Mondrian]].<ref name="Cox2013">{{harvnb|Cox|2013|p=6}}</ref> The originally intended name, ''Mondrian'', was already taken. |
||
=== Pikachu === |
|||
Pikachu is an esoteric programming language developed by Nilabhro Datta, whose programs look like the dialect of [[Pikachu]]. Its stated purpose is to be easily usable by Pikachu. Programs written in the language should be readable and writable by any Pikachu.<ref name=":0">{{Cite web|url=http://www.trove42.com/introducing-pikachu-programming-language/|title=Introducing The Pikachu Programming Language – A Programming Language Made For Pikachus|last=|first=|date=|website=|access-date=}}</ref> To this end, Pikachu makes use of only 3 valid syntax elements; <code>pi</code>, <code>pika</code> and <code>pikachu</code>.<ref>{{Cite news|url=http://trove42.com/pikachu-syntax-rules/|title=Pikachu Programming Language - Syntax Rules|date=2017-08-21|work=Trove 42|access-date=2017-08-22|language=en-US}}</ref><ref name=":0" /> |
|||
=== Rockstar === |
|||
[https://github.com/dylanbeattie/rockstar Rockstar] is designed for creating computer programs that are also song lyrics, and is heavily influenced by the lyrical conventions of 1980s hard rock and power ballads. It is dynamically typed and Turing-Complete. |
|||
In the following example the line of code multiplies the value of <code>your heart</code> by <code>the whole</code> and stores it in <code>my hands</code> . |
|||
* <code>your heart</code>, <code>the whole</code> and <code>my hands</code> are variables. |
|||
* <code>of</code> is used for multiplication and is an alias of ''times'' |
|||
* <code>Put</Code>/<code>into</code> combination is used for assignment |
|||
Put the whole of your heart into my hands |
|||
=== Shakespeare === |
=== Shakespeare === |
||
Line 151: | Line 86: | ||
=== Whitespace === |
=== Whitespace === |
||
[[Whitespace (programming language)|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. |
[[Whitespace (programming language)|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. |
||
== Fictional examples == |
|||
=== ~ath === |
|||
~ath is an esoteric programming language used by the humans and trolls in the webcomic ''[[Homestuck]]''. The name when spoken is "[[tilde]] ath", a pun on "til death." It is known to be insufferable to work with, despite its relative simplistic syntax. The language can only compile when using infinite loops. In the context of the story, it has the capability to import and change objects from a wide library, such as the author and the universe itself. This wide range, combined with the inability to interact with anything that has a short lifespan, leads to files being tied to long-term events, such as the deaths of characters and universes. ~ath is also sensitive to the color that the text is written in, and accepts unusual characters. One ~ath program shown in the story uses a command called bifurcate to split the program into red text and blue text. Another ~ath program contains a character that appears as an animated flickering [[billiard ball]]. |
|||
~ATH(THIS) { |
|||
// ADDITIONAL GRAVES... |
|||
} EXECUTE(NULL); |
|||
THIS.DIE(); |
|||
The ~ath code above is the simplest in the language, and any code deviating from the pattern does not compile. |
|||
== Cultural context == |
== Cultural context == |
Revision as of 22:58, 10 November 2019
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 esoteric distinguishes these languages from programming languages that working developers use to write software. Usually, an esolang's creators do not intend the language to be used for mainstream programming, although some esoteric features, such as visuospatial syntax,[1] have inspired practical applications in the arts. Such languages are often popular among hackers and hobbyists.
Usability is rarely a goal for esoteric programming language designers—often the 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 language was INTERCAL,[2] designed in 1972 by Don Woods and James M. Lyon, with the stated intention of being unlike any other programming language the authors were familiar with.[3][4] 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. The language's 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. It also has a compiler of only 1024 bytes.[5] 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. These are canonical examples of minimal Turing tarpits and needlessly obfuscated language features. Brainfuck is related to the P′′ family of Turing machines.
Examples
Befunge
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 >
, :
, v
, _
, ,
, and ^
.
"dlroW olleH">:v
^,_@
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!":
++++++++++[>+++++++>++++++++++>+++<<<-]>++.>+.+++++++
..+++.>++.<<+++++++++++++++.>.+++.------.--------.>+.
FRACTRAN
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 then the program halts. FRACTRAN was invented by mathematician John Conway.
GolfScript
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.
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.[4]
JSFuck
JSFuck is an esoteric programming style of JavaScript, where code is written using only six characters: [
, ]
, (
, )
, !
, 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 or engine that interprets JavaScript.[6][circular reference]
LOLCODE
LOLCODE is designed to resemble the speech of lolcats. The following is the "hello World" example:
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.[7]
Malbolge
Malbolge (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
![](https://upload.wikimedia.org/wikipedia/commons/d/d0/Piet_Program.gif)
![](https://upload.wikimedia.org/wikipedia/commons/4/48/Piet_Program_Hello_World.gif)
Piet is a language designed by David Morgan-Mar, whose programs are bitmaps that look like abstract art.[8] The compilation is guided by a "pointer" that moves around the image, from one continuous coloured region to the next. Procedures are carried through 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. Most specified procedures deal with operations on that stack, others with input/output and with the rules by which the compilation pointer moves.
Piet was named after the Dutch painter Piet Mondrian.[9] The originally intended name, Mondrian, was already taken.
Shakespeare
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:
Act I: Hamlet's insults and flattery.
Unlambda
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
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.
Cultural context
The cultural context of esolangs has been studied by people like Geoff Cox, who writes that esolangs "shift attention from command and control toward cultural expression and refusal",[10] 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,"[11] 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.[12]
References
- ^ 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.
- ^ a b 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. Retrieved 1 December 2015.
- ^ JSFuck
- ^ "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.
Further reading
- 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.
- Geoff Cox (2013). Speaking Code: Coding as Aesthetic and Political Expression. MIT Press. ISBN 978-0-262-01836-4.
External links
- Obfuscated Programming Languages at Curlie
- Esolang — a wiki devoted to esoteric programming languages