4 ms·
It's nice to see an article like this every once and a while to remind myself that there is so much about programming still to learn. I particularly liked the
by cakeface 8y ago
It's nice to see an article like this every once and a while to remind myself that there is so much about programming still to learn. I particularly liked the javascript examples so I could play with them in my scratch pad. I am still not sure I could describe what a Y Combinator is and where to use it, but I'm much closer than I was 15 minutes ago.
- arethuza 8y agoIt's over 30 years since I was taught about the Y combinator and I still find it amazing - it allows you to define recursion in a language which has no concept of recursion or named functions - such as λ-calculus. The fact that you then define this in terms of amazingly simple functions like the S and K combinators just, in my opinion, adds to how wonderful it is.
- guelo 8y agoIn those 30 years did you ever encounter the need to use these combinators?
- braythwayt 8y agoThe use of the Y Combinator to enable true memoization of a recursive function has been discussed on the 'net a number of times. I used the mockingbird version for a very specific purpose in production a while back, although that was more like corecursion than recursion.
- arethuza 8y agoOf course not - I haven't practically applied Turing Machines either. You'd have to be mad to implement a functional programming language purely in terms of S and K - which of course is what I did for my final year project and got a 1st and a prize! What my encounter with the fundamentals of Computer Science did give me (apart from the necessity of implementing things like garbage collectors) - was an abiding interest and love of the mathematical foundations of computation and with maths as something interesting rather than something to be endured. That interest did lead to me doing postgrad research in a control engineering group, which did lead to me co-founding a startup. So did I ever apply S & K in a practical circumstance - no. Am I glad I took a turn down the more mathematical side of CS - absolutely.