esolang

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

Expected: ..x,y,z,

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

TextMeans
x, abc,A variable, letters ending in a comma
?x,EThe function of x with body E
.FAF 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.
Expected: ?y,y,
Expected: a,

The third is S K K applied to a, which gives a back.

Church numerals and the @ flag. This is 2 + 3.

Expected: 5

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 !.

Expected: !

The $ is pasted in as text before anything is read. In this implementation the input is the function that keeps its second argument.

Expected: b,

Patterns it teaches

Further

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,.f,.f,.f,.f,.f,.f,.f,.f,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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 evalsfuck

Source

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