Hacker News new | ask | show | jobs
by loloquwowndueo 1825 days ago
This is awesome. I had an introductory lisp course in college and couldn’t make heads or tails of it. To this day it’s the only programming language I’ve tried and been unable to understand (“I could just never grok lisp - it’s incompatible with my brain”). Given a few introductory, free texts, I might be well on my way to remedy that :)
2 comments

It's not a Common Lisp book, but I'd highly recommend The Little Schemer if you're looking to grok lisp.
The little schemer is great, especially in understanding recursion and tail call optimization (pass an accumulator to track the result as a parameter). However I was never able to understand the chapter that builds the y combinator (and I actually was never able to understand that concept)...
If it helps, I'm rather fond of this explanation: https://mvanier.livejournal.com/2897.html

Especially this part, from toward the beginning:

> Before I get into the details of what Y actually is, I'd like to address the question of why you, as a programmer, should bother to learn about it. To be honest, there aren't a lot of good nuts-and-bolts practical reasons for learning about Y. Even though it does have a few practical applications, for the most part it's mainly of interest to computer language theorists.

The article goes on to explain why you should learn it, anyway, but, still, it's not like monads and Haskell. Despite the concept's intellectual cachet, you don't need to understand it to be an effective lisper. That said, this opinion is mine and mine alone, and stands in direct contradiction to the sentiment expressed in the following paragraph.

Thanks for the link I'll take a look. I agree that you don't need to understand y to be an effective lisper. I have used lisp and various other functional languages over the years in various projects and there wasn't a use case for y combinator...
Its official use case is hacking recursion into a language that doesn't support recursion, but does have first-class functions. To the best of my knowledge, the only language that fits this description is the lambda calculus itself.

There is a paper, Y in Practical Programs ( https://blog.klipse.tech/assets/y-in-practical-programs.pdf) that presents some interesting things you can layer on top of the technique. I'll leave it up to others to debate whether doing so is genuinely practical, or more of a game of functional code golf.

It took me a couple of years and several attempts to really get there. Don't give up! ;-)