Conti
A lambda calculus where nothing ever returns. Every function hands its result to the next one.
Hakerh400, 2026 · Turing complete: yes · ●●● hard · esolangs.org
Tested with 3 known programs · Test method
Run it
The idea
Hakerh400 made Conti in 2026. A program is a list of definitions, each a lambda, and the run reduces main <inp> out at its head, one step at a time. An argument can be a name or a lambda but never an application, so nothing can be computed inside an argument. Every result has to be passed on to a continuation, which is continuation-passing style made into the only way to write.
Read the story
There are no numbers and no characters. Input and output are bits, and the program reads and writes them through two special terms that it gets from the start.
The machine
| Head of the main expression | Becomes |
|---|---|
| a name | Its definition |
| a lambda | The body, with the arguments put in |
<inp> | \a, a \a b, b \a, a on a 0 bit, \a, a \a b, a \a, a on a 1 bit |
<out_0> <out_1> | \a, a \a, a, after writing the bit |
The output function that main gets is \a, a (\_, <out_1>) (\_, <out_0>), so it takes a boolean and writes it. Each input bit is read after a 1, and after the end every read gives 0, so a program can tell where the input stops. Written bits alternate in the same way, a control bit and then a data bit, and a control bit of 0 ends the run. The specification does not say how bits meet the outside world; this implementation uses the characters 0 and 1.
Example
A cat.
A cat. It reads the control bit; while it is 1, it reads a bit and writes 1 and that bit, then starts over.
The program reads the bits into a list, reverses it, maps not over it and writes it out.
Patterns it teaches
- Lambda encoding: booleans pick one of two continuations, and a list is a pair of a flag and a pair.
- Combinators: the whole language is functions applied to names and functions.
Further
See also
Also in Functional and concatenative
Write your own in Run Convert a program from Conti
Implementation
JavaScript interpreter, source and command line
A JavaScript interpreter, used in the browser and on the command line. Id: conti.
Command line
shib run conti program.txt --input '110'The program is long; save it as program.txt first.
shib manual contiSource
- Module
langs/wiki/ports.js- Interpreter
langs/wiki/conti.js
Docs: Kernel instructions · The .shib format · Command line · Adding a language
Source esolangs.org (CC0) · Edit on esolangs.org