←back to thread

Hofstadter on Lisp (1983)

(gist.github.com)
372 points Eric_WVGG | 1 comments | | HN request time: 0s | source
Show context
oaktowner ◴[] No.41861304[source]
I just love his writing so much -- he captures what I felt when I discovered Lisp. As a kid learning programming in the 80s, I had already done some BASIC, Fortran, Pascal and COBOL in high school and early college. There were differences, of course, but they had some fundamental commonality.

At UC Berkeley, however, the first computer science class was taught in Scheme (a dialect of Lisp)...and it absolutely blew me away. Hofstadter is right: it feels the closest to math (reminding me a ton of my math theory classes). It was the first beautiful language I discovered.

(edit: I forgot to paste in the quote I loved!)

"...Lisp and Algol, are built around a kernel that seems as natural as a branch of mathematics. The kernel of Lisp has a crystalline purity that not only appeals to the esthetic sense, but also makes Lisp a far more flexible language than most others."

replies(2): >>41863008 #>>41863500 #
Jeff_Brown ◴[] No.41863008[source]
Have you tried Haskell? It feels much closer to math to me. Definitions, not procedures. It even looks like math.
replies(3): >>41863350 #>>41865297 #>>41867173 #
oaktowner ◴[] No.41863350[source]
No! After about 10 years of writing software professionally, I moved over to product management, and my time spent coding decreased drastically (in the last 15 years, only some Python to show my kids a thing or two).

But I'd love to try! Maybe I'll take an online class for fun.

replies(2): >>41864278 #>>41868816 #
Jeff_Brown ◴[] No.41864278[source]
I can't recommend it highly enough. You're already familiar with laziness from Lisp, but purity is another head-trip. It made me a better programmer in any language, and even a better software architect before I've written a line of code.

And algebraic data types make it possible to make your code conform to reality in ways that classes can't. Once you're exposed to them, it's very much like learning about addition after having been able to multiply for your whole life. (In fact that's more than a metaphor -- it's what's happening, in a category theoretic sense.)

Haskell has other cool stuff too -- lenses, effect systems, recursion schemes, searching for functions based on their type signatures, really it's a very long list -- but I think laziness, purity and ADTs are the ones that really changed my brain for the better.

replies(2): >>41864839 #>>41865980 #
chamomeal ◴[] No.41865980[source]
Damn that was a really good pitch. I think I’m too dumb to learn Haskell though lol. I’m struggling enough with immutability in clojure!!
replies(3): >>41867076 #>>41867919 #>>41871125 #
1. fredrikholm ◴[] No.41867919[source]
> I think I’m too dumb to learn Haskell though lol.

I felt the same way, a lot of people feel that way.

This is in part because FP is difficult, typed FP is difficult, and Haskell is difficult. All by themselves. They do get easier once you intuit more and more FP in general I'd say.

Then there's also a phenomena described in the Haskell Pyramid[0] where it sometimes appears more difficult than it really is.

Like a lot of things, actually building something gets you a long way, esp. with the advent of chat AIs as it's comparatively easy to go back an fourth and learn little by little.

[0] https://patrickmn.com/software/the-haskell-pyramid/