3 ms·
Go Haskell. It's even more different from Lisp & Algol-like languages than the difference between Lisp & Algol-like languages. Lisp & Algol-like has the differ
by meric 11y ago
Go Haskell. It's even more different from Lisp & Algol-like languages than the difference between Lisp & Algol-like languages.
Lisp & Algol-like has the difference where Lisp's code is also data and its code can rearrange code using macros written in Lisp itself. Both can have functional programming inspired constructs like `map` and `fold` as functions.
Haskell is different because all its code is lazy. So if you write `take 1 (map ((*) 2) [1..1000000000000])`, it runs instantly even though writing idiomatic lisp or python or C will have the computer spinning for ages going through all those numbers you don't even use. It also has partial application of functions, as well as pure functional programming by preventing you to write a line that doesn't contribute to the returned value. The sophisticated type system I have not ever seen outside of the ML family of languages, either.
I haven't read the Dragon Book, but I've written some compilers in my free time, and my compiler code was much better after I had a go at Haskell.