Evalsfuck
The lambda calculus without a single parenthesis, and input that is pasted into the source before it runs.
2026 · Turing complete: yes · ●●○ moderate · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Evalsfuck was made in 2026 as a joke, but under the jokes is the plain untyped lambda calculus. It is written in prefix notation, so there are no brackets to close. A program is one expression, and the run reduces it to its normal form and prints that as Evalsfuck source.
Read the story
Input works as text. Every $ in the source is replaced by a line of input before the program is read, even in the middle of a name, and a $ that arrives with the input is replaced in its turn. So the output of one program can be piped into the source of the next.
The machine
| Text | Means |
|---|---|
x, abc, | A variable, letters ending in a comma |
?x,E | The function of x with body E |
.FA | F applied to A |
$ | Replaced by the next line of input before the run |
Spaces, line breaks and parentheses are ignored. A first character that cannot be part of a program is a flag. @ prints the result as a Church numeral in decimal, and # prints it as a Church list of numerals, one character each. Free variables keep their names in the output. In this implementation a function keeps its name too, unless that would catch a variable from outside; then it gets letters added, so the y of .?x,?y,x,y, comes out as ?ya,y,.
Example
The third is S K K applied to a, which gives a back.
The third is S K K applied to a, which gives a back.
Church numerals and the @ flag. This is 2 + 3.
With # the result is a list built from c and n, and each element is a numeral. The Hello World is twelve of them, 3,451 characters in all. This is one, 33, which is !.
The $ is pasted in as text before anything is read. In this implementation the input is the function that keeps its second argument.
Patterns it teaches
- Lambda encoding: numbers, lists and strings are all functions.
- Combinators: S K K is the identity.
- Self-modifying code: the input becomes part of the source.
Further
See also
Functional paradigm
Write your own in Run Convert a program from Evalsfuck
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: evalsfuck.
Command line
shib run evalsfuck -e '#$' --input '?cons,?nil,..cons,?f,?x,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.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f,.f,.f,.f,.f,.f,.f,.f,x,..cons,?f,?x,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,.f,x,nil,
'shib manual evalsfuckSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/evalsfuck.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org