59 points · by frankpinto · 11y ago · 15 comments
The good news is that I now know where the name Y Combinator comes from. I imagine it will take me a lot longer to wrap my head around that concept, though. Truly weird haha.
https://gist.github.com/sanxiyn/523967
It was one of many from the link below. The Scheme in Racket example would've been even easier to specify concretely because it's so easy to implement read in a Scheme. Gets the C and C++ implementations more props for doing things directly. Real question is how small can those go?
I do agree that the realization that it's possible to build recursive functions in the lambda calculus is mind-blowing (and far from obvious!)
Here is an example in prolog of such a meta interpreter.
interpret(true):- !.
interpret(GoalA, GoalB):- !,interpret(GoalA),interpret(GoalB).
interpret(Goal):- clause(Goal, Body), interpret(Body).