π
π is an esoteric programming language currently developed by User:Fogity. It is a fairly straight forward lazy functional language with the caveat that the source code, input, and output must consist solely of emoji.
Language
The language consists of four elements: sequences, definitions, variables and literals.
Sequences are just series of elements and are enclosed in π and π.
Definitions are on the form
π<param count><name><params><body>π
Any emoji not used for syntax may be used as variables and the param count may be omitted if it is zero.
More details on the language can be found on the repository wiki of the official interpreter.
Execution
A function grabs as many arguments as it needs from successive elements in the sequence and is then executed, this is then repeated for the remaining elements in the sequence.
The language is lazy by default, but the modifiers π and π may precede parameters to make all or specific arguments strict.
Example programs
Hello, world!
π¬π€ππΊοΈπ€
Due to the emoji-restriction the output string is not the classic "Hello, world!" but an emoji equivalence.
A palindrome
π¬π£π¬
Cat
π¬β¨οΈ
The input is of course restricted to emoji, and the input convention must be followed.
Fibonacci sequence
π2οΈβ£ππβͺβοΈπ¬βοΈπβοΈπββͺβοΈπππ1οΈβ£1οΈβ£
Factorial
π1οΈβ£ππ#οΈβ£βπβοΈ#οΈβ£0οΈβ£π1οΈβ£πβοΈ#οΈβ£πππβ#οΈβ£1οΈβ£πππππ¬ππποΈπ
Ackermann function
π2οΈβ£πππ΄π΅βπβοΈπ΄0οΈβ£ππβπ΅1οΈβ£ππππβπ΄1οΈβ£ππβπβοΈπ΅0οΈβ£π1οΈβ£πππ΄πβπ΅1οΈβ£ππππππ¬ππποΈποΈπ
Truth-machine
πππ¬1οΈβ£ππβπβοΈποΈ0οΈβ£πππ¬0οΈβ£ππ
FizzBuzz
π3οΈβ£π―πππΌ#οΈβ£ππ₯€βοΈπ1οΈβ£πππβοΈπΌ1οΈβ£ππ¬πβπ₯€πβππ€π₯€ππ€π£π₯€ππβππ£π#οΈβ£πππ―πβπ₯€3οΈβ£πβπ1οΈβ£πππβπ5οΈβ£πβπΌ1οΈβ£πππβ#οΈβ£1οΈβ£πππ―3οΈβ£5οΈβ£1οΈβ£
Like with the hello world program the emoji π₯€ and π replace the words "fizz" and "buzz", respectively.
Turing-completeness
The language is Turing-complete as it is easy to model the lambda calculus in it. Variables are equivalent to π variables. Application is equivalent to π application, but will generally need to be enclosed in a sequence. Abstractions are mostly equivalent to single parameter definitions, however they must be named and the definition must be followed by it's variable name, and they should also be enclosed in a sequence.
As an example here is the Y combinator (see Combinatory logic) written in π as a lambda term:
π1οΈβ£β½πππ1οΈβ£πβΎππβΎβΎππππππ1οΈβ£πβΎππβΎβΎπππππβ½