Esoteric programming language: Difference between revisions

Content deleted Content added
Tags: Mobile edit Mobile web edit
Tags: Mobile edit Mobile web edit
Line 46:
More esoterically, nondeterministic algorithms have been employed in the theoretical investigation of [[hypercomputation]].
 
== Examples ==
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">
Line 63 ⟶ 64:
 
=== 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>.
<syntaxhighlight lang="befunge">
"dlroW olleH">:v
Line 98 ⟶ 99:
 
=== 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> then the program halts. FRACTRAN was invented by mathematician [[John Horton Conway|John Conway]].
 
=== .Gertrude ===
Line 107 ⟶ 108:
 
=== 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 ===
Line 117 ⟶ 118:
 
=== LOLCODE ===
[[LOLCODE]] is designed to resemble the speech of [[lolcat]]s. The following is the "hello worldWorld" example:
<pre>
HAI
Line 163 ⟶ 164:
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=|archive-url=|archive-date=|dead-url=|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 hand"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
Line 186 ⟶ 187:
 
=== Unlambda ===
[[Unlambda]] is a minimalist functional programming language. Most programs consist solely of the characters <code>s</code>, <code>k</code>, and <code>`</code>.
 
=== Whitespace ===