3 ms·
> a half-page of code is sufficient to define a basic Lisp interpreter in Lisp given a few primitives (car, cdr, cons, eq, atom). One line of code is sufficien
by tromp 2y ago
> a half-page of code is sufficient to define a basic Lisp interpreter in Lisp given a few primitives (car, cdr, cons, eq, atom).
One line of code is sufficient to define the 206-bit BLC interpreter in BLC given no primitives whatsoever [1] :
(λ11)(λλλ1(λλλλ3(λ5(3(λ2(3(λλ3(λ123)))(4(λ4(λ31(21))))))(1(2(λ12))(λ4(λ4(λ2(14)))5))))(33)2)
This code tokenizes and parses (something the Lisp code skips) the binary encoding of a lambda term from an input bitstream and applies that term to the remainder of input.
[1] https://tromp.github.io/cl/cl.html https://tromp.github.io/cl/cl.html