Esoteric programming language: Difference between revisions

Content deleted Content added
added amitabhc language
explicitly listed unqualified examples
 
(8 intermediate revisions by 5 users not shown)
Line 1:
{{Short description|Experimental or artistic programming language}}
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 live [[Data and information visualization|visualization]] of code,<ref>{{cite conference |last1=McLean |first1=A. |last2=Griffiths |first2=D. |last3=Collins |first3=N. |last4=Wiggins |first4=G. |date=2010 |title=Visualisation of Live Code |conference=Electronic Visualisation and the Arts 2010 |___location=London |url=https://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.
Line 6:
==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/9780262062749/software-studies/}}</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 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|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 89 ⟶ 83:
 
=== Minecraft ===
[[Minecraft]] is a [[sandbox game]] developed by Mojang Studios, which contains a turingTuring-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 120 ⟶ 114:
=== 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}}
 
=== AmitabhC ===
[[AmitabhC]] is designed to resemble [[Bollywood]] cinema dialogue and references from legendary actor [[Amitabh Bachchan]]'s films. Programs are structured like film productions with <code>LIGHTS</code>, <code>CAMERA</code>, and <code>ACTION</code> blocks, while incorporating interactive elements inspired by the game show "[[Kaun Banega Crorepati]]" including <code>PHONE_A_FRIEND</code> and <code>AUDIENCE_POLL</code> commands.<ref>{{Cite web |url=https://jay123anta.github.io/amitabhc/ |title=AmitabhC - The Bollywood Programming Language |access-date=2025-06-13}}</ref> The following is the "Hello World" example:
 
<pre>
LIGHTS
CAMERA
DEVIYON_AUR_SAJJANO
VIJAY name = "Amitabh Bachchan"
BOLO "Namaste! Main hoon AmitabhC!"
ACTION
</pre>
 
The language uses [[Hindi]] phrases for common programming constructs: <code>DEVIYON_AUR_SAJJANO</code> (Ladies and Gentlemen) begins programs, <code>BOLO</code> serves as the print statement, <code>VIJAY</code> and <code>DON</code> declare variables referencing Bachchan's iconic film characters, and <code>AGAR</code> implements conditional logic. AmitabhC represents a [[cultural parody]] approach to esoteric programming, making coding accessible through familiar [[Indian cinema]] references while maintaining enterprise-grade security features.<ref>{{Cite web |url=https://jay123anta.github.io/amitabhc/ |title=AmitabhC - The Bollywood Programming Language |access-date=2025-06-13}}</ref>
 
== 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 claims that "esolangs are open-ended systems, natively collaborative, and distanced from any single materialized form,", which "challenge or re-affirm wider ideas in programming culture and in how computer science is taught"," including the neutral, "professional" style advocated in [[Edsgar Dijkstra]]'s ''The Humble Programmer''. <ref>{{cite journal|last=Temkin|first=Daniel|title=The Less Humble Programmer|journal=DHQ: Digital Humanities Quarterly|date=2023|volume=17|number=2|url=https://www.digitalhumanities.org/dhq/vol/17/2/000698/000698.html}}</ref>
 
==References==