> You lean back, exhausted but triumphant.
> Dana is dead.
Thank you for a good laugh.
https://aphyr.com/posts/353-rewriting-the-technical-intervie...
Note that S and K are curried functions which take one argument at a time. Further reading: https://stackoverflow.com/a/36321/
brilliant work!
Great article by the way.
let A = (x) => (y) => (z) => x(z)(y((w) => z))
Just need to combine this a few times. let K = A(A(A))(A(A(A))(A)(A)(A)(A)(A); // (x) => (y) => x
let S = A(A(A(A)(A(A)(A(A)))(A(A(A(A)((A(A)))))))(A)(A); // (x) => (y) => (z) => x(z)(y(z))
> “I would never be caught dead using Lambda calculus. It’s a bloated language.”Actually, combinatory logic is more bloated than lambda calculus, generally needing more bits to express the same program [1].
> Dana smirks. “Well, yeah. JavaScript is an eager language. Can’t use the Y combinator.”
Eager languages can be made lazy by wrapping arguments in lambdas with dummy arguments, as done in the Javascript BLC interpreter [2].
abstractspoon•2h ago