3 ms·
The lack of numbers is not too great a handicap, as one can design numbers to suits one's needs. For instance, the following is a program for computing the char
by tromp 8y ago
The lack of numbers is not too great a handicap, as one can design numbers to suits one's needs. For instance, the following is a program for computing the characteristic sequence of primes:
\io.let
zero = \x\y.x;
one = \x\y.y;
consz = \xs\p.p zero xs;
oneS = \cont\x\xs\p.p x (xs cont);
zeroS = \cont\x\xs.consz (xs cont);
primes = \N\p.p one (let SN = \r.oneS (N r); F = SN F in (primes SN) F);
main = consz (consz (primes zeroS))
in main
Removing the minimal syntactic sugar results in
\io.(\zero.(\one.(\consz.(\oneS.(\zeroS.(\primes.(\main.main) (consz (consz (primes zeroS)))) ((\f.(\x.x x) (\x.f (x x))) (\primes.\N.\p.p one ((\SN.(\F.primes SN F) ((\f.(\x.x x) (\x.f (x x))) (\F.SN F))) (\r.oneS (N r)))))) (\cont.\x.\xs.consz (xs cont))) (\cont.\x.\xs.\p.p x (xs cont))) (\xs.\p.p zero xs)) (\x.\y.y)) (\x.\y.x)
which can be run, as a 167 bit executable, on a binary lambda calculus machine to produce the infinitely long
00110101000101000101000100000101000001000101000100...
See http://www.ioccc.org/2012/tromp/hint.html http://www.ioccc.org/2012/tromp/hint.html for details