Esoteric programming language: Difference between revisions

Content deleted Content added
rm two other non-notable esolangs ("REON-4213", "Rockstar")
explicitly listed unqualified examples
 
(47 intermediate revisions by 27 users not shown)
Line 1:
{{Short description|ProgrammingExperimental languageor notartistic aimedprogramming for serious uselanguage}}
An '''esoteric programming language''' (sometimes shortened to '''esolang''') or '''weird language'''{{r|":2"|page=5}} 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 ''[[wiktionary:esoteric|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 [[Spatial–temporal reasoning|visuospatial]]live [[syntaxData (programmingand languages)information visualization|syntaxvisualization]] of code,<ref>{{cite conference |last1=McLean, |first1=A., |last2=Griffiths, |first2=D., |last3=Collins, |first3=N., and |last4=Wiggins, |first4=G. (|date=2010). "|title=Visualisation of Live Code". In ''|conference=Electronic Visualisation and the Arts'', 2010 |___location=London |url=https: 2010//www.researchgate.net/publication/228575469}}</ref> have inspired practical applications in the arts. Such languages are often popular among [[Hacker culture|hackers]] and hobbyists.{{Citation needed|date=July 2021}}
 
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 completeness|Turing-complete]], or even one for which the [[Computability theory|computational class]] is unknown.
 
==History==
[[File:Hello World INTERCAL.png|thumb|"[["Hello, World!" program|Hello World!]]" program in INTERCAL]]
The earliest, and still the canonical example of an esoteric programming language, is [[INTERCAL]],<ref name="software-studies">{{Cite book |first=Matthew |last=Fuller, [|title=Software studies: a lexicon |date=2008 |publisher=MIT Press |isbn=978-0-262-06274-9 |oclc=1156851190 |url=https://mitpress.mit.edu/books9780262062749/software-studies Software Studies], MIT Press, 2008/}}</ref> designed in 1972 by [[Don Woods (programmer)|Don Woods]] and James M. Lyon, who said that their intention was to create a programming language unlike any with which they were familiar.,<ref name="Raymond1996">{{cite book|author=Eric S. Raymond|title=The New Hacker's Dictionary|url=https://books.google.com/books?id=g80P_4v4QbIC&pg=PA258|year=1996|publisher=MIT Press|isbn=978-0-262-68092-9|page=258}}</ref> namely [[FORTRAN]], [[BASIC]], [[COBOL]], [[ALGOL]], [[SNOBOL]], [[SPITBOL]], [[FOCAL (programming language)|FOCAL]], SOLVE, TEACH, [[APL (programming language)|APL]], [[LISP]], and [[PL/I]].<ref name="woods-lyon-intercal">{{citation|url=https://muppetlabs.com/~breadbox/intercal/intercal.txt |last1=Woods |first1=Donald R. |last2=Lyon |first2=James M. |year=1973 |title=The INTERCAL Programming Language Reference Manual |access-date=2023-05-01 |publisher=Muppetlabs.com}}</ref> It [[parody|parodied]] elements of established programming languages of the day such as [[Fortran]], [[COBOL]] and [[assembly language]].{{r|":2"|page=5}}
 
For many years, INTERCAL was represented only by paper copies of the INTERCAL manual. Its revival in 1990 as an implementation in [[C (programming language)|C]]{{r|":2"|page=6}} under [[Unix]] stimulated a wave of interest in the intentional design of esoteric computer languages.
 
{{anchor|FALSE}}
Line 14 ⟶ 15:
 
== 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.<ref>{{Cite book |firstname=Matthew |last=Fuller |title=Software "software-studies:" a lexicon |date=2008 |publisher=MIT Press |isbn=978-0-262-06274-9 |oclc=1156851190}}</ref> Many esoteric programming languages, such as [[brainfuck]], and similar, use single characters as commands, however, it is not uncommon for languages to read line by line like conventional [[programming language]]s.
 
=== Unique data representations ===
Conventional [[Imperative programming|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 (computer programming)|pointer]], which must be moved to a ___location of interest before data is read. Others, like [[Befunge]] and [[Shakespeare Programming Language|Shakespeare]], utilize one or more [[Stack (abstract data type)|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 numeral system|ternary]] system.<ref name=":1">{{cite book |last=Morr, |first=Sebastian. "|title=Esoteric Programming Languages." (|date=2015) |url=https://blinry.org/esolangs/esolangs.pdf |s2cid=160025019}}</ref>
 
=== Unique instruction representations ===
Esoteric languages also showcase unique ways of representing program instructions. Some languages, such as [[Befunge]] and [[#Piet|Piet]], represent programs in two or more dimensions, with program control moving around in multiple possible directions through the program.{{sfn|Cox|2013}}{{page needed|date=June 2022}} 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 Programming Language|Shakespeare]] achieves this by making all programs resemble Shakespearian plays. [[Chef programming language|Chef]] achieves the same by having all programs be recipes.<ref name=":1" /> 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 this double meaning.<ref>{{Cite web |last=Mike |date=2013-03-31 |title=Baking a Hello World Cake |url=https://www.mike-worth.com/2013/03/31/baking-a-hello-world-cake/ |access-date=2023-05-01 |website=Products of Mike's Mind |archive-url=https://web.archive.org/web/20230501044254/https://www.mike-worth.com/2013/03/31/baking-a-hello-world-cake/ |archive-date=2023-05-01 |url-status=dead}}</ref>
 
=== Difficulty to read and write ===
Many esoteric programming languages are designed to produce code that is deeply [[Obfuscation (software)|obfuscated]], making it difficult to read and to write.<ref name=":2">{{cite conference |last1=Mateas, |first1=M. and |last2=Montfort, |first2=N. |title=A Box, Darkly: Obfuscation, Weird Languages, and Code Aesthetics. In ''|conference=Digital Arts and Culture: Digital Experience: Design, Aesthetics, Practice'' ''(DAC 2005)'', |___location=Copenhagen, Denmark, |date=2005 |url=https://nickm.com/cis/a_box_darkly.pdf}}</ref> 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.<ref name=":2" /> 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.<ref name=":2" />
 
=== Parody and spoof ===
Line 33 ⟶ 34:
 
=== Befunge ===
[[Befunge]] allows the instruction pointer to roam in multiple dimensions through the code. For example, the following program displays [["Hello, World!" program|"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|>|befunge}}, <{{code>|:</code>|befunge}}, <{{code>|v</code>|befunge}}, <{{code>|_</code>|befunge}}, <{{code>|,</code>|befunge}}, and <{{code>|^</code>|befunge}}.
 
<syntaxhighlight lang="befunge">
{{Syntax highlight|
"dlroW olleH">:v
^,_@
</syntaxhighlight>
|befunge}}
There are many versions of Befunge, the most common being Befunge-93, which is named as such because it was released in 1993.<ref>{{Cite web|url=https://catseye.tc/article/Languages.md|title=Languages}}</ref>
 
There are many versions of Befunge, the most common being Befunge-93, which is named as such because itof wasits releasedrelease in 1993year.<ref>{{Cite web|url=https://catseye.tc/article/Languages.md|title=Languages|website=Cat's Eye Technologies}}</ref>
 
=== 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.<ref>{{cite web |author=John Tromp |title=Most functional |url=https://www.ioccc.org/2012/tromp/index.html |publisher=The International Obfuscated C Code Contest |archive-url=https://web.archive.org/web/20250117050155/https://www.ioccc.org/2012/tromp/index.html |archive-date=2025-01-17 |url-status=live}}</ref>
| url=https://www.ioccc.org/2012/tromp/hint.html
| title=Most functional
| author=John Tromp
| publisher=The International Obfuscated C Code Contest
}}</ref>
 
=== Brainfuck===
Line 56 ⟶ 54:
 
All characters other than {{code|lang=bf|+-<>,.[]}} are ignored.
 
=== Chicken ===
Chicken has just three tokens, the word "chicken", " " (the space character), and the newline character. The compiler interprets the number of "chickens" on a line as an opcode instruction which it uses to manipulate data on a stack. A simple chicken program can contain dozens of lines with nothing but the word "chicken" repeated countless times.<ref>{{Cite web|title="Hello world" in Esoteric Programming Languages? (Esolangs)|url=https://dev.to/jbc7ag/hello-world-in-esoteric-programming-languages-esolangs-5122|access-date=2022-12-04|website=DEV Community 👩‍💻👨‍💻|date=25 July 2020 |language=en}}</ref> Chicken was invented by Torbjörn Söderstedt who drew his inspiration for the language from a parody of a scientific dissertation.<ref>{{Cite web|date=2018-08-08|title=Weirdest Programming Languages {{!}} Programming|url=https://www.omnesgroup.com/weirdest-programming/|access-date=2022-12-04|website=www.omnesgroup.com|language=en-US}}</ref><ref>{{Cite web|date=27 April 2022|title=8 Goofy Programming Languages|url=https://www.thecodingspace.com/blog/2022-04-27-8-goofy-programming-languages/}}</ref><ref>{{Cite web |last=Hongkiat.com |date=2021-09-08 |title=10 Most Bizarre Programming Languages, Vol. 2 |url=https://www.hongkiat.com/blog/bizarre-insane-programming-languages/ |access-date=2022-12-04 |website=Hongkiat |language=en-US}}</ref>
 
=== Chef ===
Chef is a [[stack-oriented programming language]] created by [[David Morgan-Mar]], designed to make programs look like [[Recipe|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=https://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|access-date=2023-05-01}}</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]] with "101 eggs" and "{{cups|111 cups|US}} oil" would produce "a lot of food for one person.".<ref name="chef"/><ref>{{cite web|url=https://dangermouse.net/esoteric/chef_hello.html|title=Chef - Hello World|work=DM's Esoteric Programming Languages|first=David|last=Morgan-Mar|publisher=Self-published|date=2014-06-28|access-date=2023-05-01}}</ref>
 
=== FRACTRAN ===
A [[FRACTRAN]] program is an ordered list of positive fractions together with an initial positive integer input <math>n</math>. The program is run by multiplying the integer <math>n</math> by the first fraction <math>f</math> in the list for which <math>nf</math> is an integer. The integer <math>n</math> is then replaced by <math>nf</math> and the rule is repeated. If no fraction in the list produces an integer when multiplied by <math>n</math>, the program halts. FRACTRAN was invented by mathematician [[John Horton Conway|John Conway]].<ref>{{cite book |last1=Kneusel |first1=Ronald |title=Strange Code: Esoteric Languages That Make Programming Fun Again |date=2022 |publisher=No Starch Press |isbn=978-1718502406 |page=217 |ref=kneusel-strange-code-fractran}}</ref>
 
=== GolfScript ===
Programs in GolfScript, a language created for [[code golf]], 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.<ref>{{cite web|url=http://www.golfscript.com/golfscript/tutorial.html|title=GolfScript Tutorial|first=Darren|last=Smith|year=2007}}</ref>
 
=== INTERCAL ===
Line 74 ⟶ 66:
=== JSFuck ===
[[JSFuck]] is an esoteric programming style of [[JavaScript]], where code is written using only six characters: <code>[</code>, <code>]</code>, <code>(</code>, <code>)</code>, <code>!</code>, and <code>+</code>.
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.<ref>{{Cite web|url=https://thedailywtf.com/articles/bidding-on-security|title=Bidding on Security|last=Bailey|first=Jane|date=2016-02-29|website=The Daily WTF|language=en|access-date=2020-03-02}}</ref><ref>{{Cite web|url=https://alligator.io/js/exploring-jsfck/|title=Exploring JSF*ck|website=alligator.io|language=en|access-date=2020-03-02|archive-url=https://web.archive.org/web/20200302154212/https://alligator.io/js/exploring-jsfck/|archive-date=2020-03-02|url-status=dead}}</ref> It has been used in a number of [[cross-site scripting]] (XSS) attacks on websites such as [[eBay]] due to its ability to evade cross-site scripting detection filters.<ref name="ArsTechnica 2016 eBay">{{cite web|url=https://arstechnica.com/security/2016/02/ebay-has-no-plans-to-fix-severe-bug-that-allows-malware-distribution/|title=eBay has no plans to fix "severe" bug that allows malware distribution [Updated]|work=Ars Technica|author=Dan Goodin|date=3 February 2016}}</ref>
 
=== LOLCODE ===
Line 89 ⟶ 81:
=== Malbolge ===
[[Malbolge]] (named after the [[Malebolge|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.<ref>{{Cite web|title = Interview with Ben Olmstead|url = https://esoteric.codes/blog/interview-with-ben-olmstead|last = Temkin|first = Daniel|date = 2014-11-03|website = esoteric.codes|accessdate = 2021-01-07}}</ref>
 
=== ChickenMinecraft ===
[[Minecraft]] is a [[sandbox game]] developed by Mojang Studios, which contains a Turing-complete redstone system{{Explain-wrap|date=July 2025|reason="Redstone" appears to be a material within Minecraft; this needs to explain what a "restone system" is for people unfamiliar with that particular meaning of "redstone".}} for logical processing.<ref>{{Cite web |title=8-Bit Computer (Turing Complete) - Redstone Creations - Redstone Discussion and Mechanisms - Minecraft: Java Edition - Minecraft Forum - Minecraft Forum |url=https://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/redstone-creations/3043582-8-bit-computer-turing-complete |access-date=2025-06-08 |website=www.minecraftforum.net}}</ref> It can be considered a three-dimensional esolang.
 
=== Piet ===
Line 110 ⟶ 105:
 
=== Shakespeare ===
[[Shakespeare (programmingProgramming language)|ShakespeareLanguage]] (SPL) 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:{{citation needed|date=April 2022}}
 
[[Hamlet#Act I|Act I: Hamlet's insults and flattery.]]
Line 118 ⟶ 113:
 
=== Whitespace ===
[[File:Whitespace in vim2.png|right|206px|thumb|Whitespace [[hello world program]] with syntax highlighting {{legend|#0000ab|tabs}} {{legend|#ab0000|spaces}}]]
[[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.{{citation needed|date=April 2022}}
 
== Cultural context ==
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",<ref>{{harvnb|Cox|2013|page=5}}</ref> seeing esolangs as similar to code art and code poetry, such as [[Mez Breeze]]'s [[mezangelle]], a belief shared by others in field.<ref>{{Cite web |title=The true meaning of esoteric programming languages |url=https://www.apifonica.com/en/blog/esoteric-programming-languages/ |access-date=2023-11-30 |website=Apifonica |language=en}}</ref> Daniel Temkin describesclaims Brainfuck asthat "refusingesolangs toare easeopen-ended thesystems, boundarynatively between human expressioncollaborative, and assemblydistanced codefrom andany therebysingle takingmaterialized usform", onwhich a ludicrous journey of logic,"<ref>{{citechallenge journal|last=Temkin|first=Daniel|title=Glitchor && Human/Computer Interaction|journal=NOOART: The Journal of Objectless Art|date=15 January 2014|issue=1|url=https://nooart.org/post/73353953758/temkinre-glitchhumancomputerinteraction}}</ref>affirm exposingwider theideas inherentin conflictprogramming betweenculture humanand thinkingin andhow computer logicscience byis deconstructingtaught", theirincluding relationship.the Heneutral, connects"professional" programmingstyle withinadvocated an esolang to performing an event score such as those of thein [[FluxusEdsgar Dijkstra]]'s movement, where playing out the irregular rules of the logic in code makes the point of view of the''The languageHumble clearProgrammer''.<ref>{{cite journal|last=Temkin|first=Daniel|title=brainfuckThe Less Humble Programmer|journal=DHQ: Digital Humanities Quarterly|date=2023|volume=17|number=2|url=https://medianwww.newmediacaucusdigitalhumanities.org/tracing-newmediafeminismsdhq/brainfuckvol/|journal=Media-N Journal|date=8 May 2013 |issue=Spring 2013|access-date=2023-05-0117/2/000698/000698.html}}</ref>
 
==References==
Line 134 ⟶ 130:
{{Commons category|Esoteric programming languages}}
* [https://esolangs.org/wiki/Main_Page Esolang, the esoteric programming languages wiki]
* {{curlie|Computers/Programming/Languages/Obfuscated/|Obfuscated Programming Languages}}
 
{{Types of programming languages}}
{{Use dmy dates|date=July 2017}}
 
{{Esoteric programming languages}}
 
{{DEFAULTSORT:Esoteric Programming Language}}
[[Category:Programming language classification]]
[[Category:Esoteric programming languages| ]]
[[Category:Computer humorhumour]]