4 ms·
Haskell and Lisp complement each other in a lot of ways. Lisp is about empowering the programmer, and building on that empowerment. Haskell is about restricting
by jerf 10y ago
Haskell and Lisp complement each other in a lot of ways. Lisp is about empowering the programmer, and building on that empowerment. Haskell is about restricting the programmer, and then building on those restrictions. For a clear example, consider STM, how it works in Haskell, and how it doesn't work particularly well in Lisp because of the inability to restrict transactions in the necessary way.
Lisp is good to learn, but because it has "won" in a lot of ways I'm not convinced it's as important as it used to be. Lisp acquired its reputation in a world where a C programmer would pick up Lisp and holy shit dynamic typing, first-class functions, garbage collection, REPL, macros, powerful syntax-aware editors (which C got, but later), atoms, recursion, violent foaming at the mouth and falling down in sheer awe. If it's still your first language after C, sure. But if you learned, say, Python in school, the list comes back to "macros, which you really shouldn't make much use of in the more modern understanding, and a bigger focus on recursion". Less likely to make you pass out in awe.
(Since I find I sometimes piss people off by claiming Lisp is less than the bee's knees, remember, it's because Lisp won in a lot of ways. It blazed a trail that every modern language today has traveled to some extent or other.)
Haskell still has a counter-cultural element because of the fact that Lisp is quite dominant right now and most languages are about empowering the programmer to do anything at any time. The restrictions-based languages are just starting an ascent (currently probably being led in practice by Rust, I think, if it's not already bigger than Haskell it probably will be in less than a year), but it's still pretty early.
- mordocai 10y agoOnly thing I'd add is that homoiconicity is a big selling point that python doesn't have either. So "macros, a focus on recursion, and homoiconicity" might be the short list of things lisp has that python doesn't. (Common Lisp is also truly multi paradigm, unlike python)
- jerf 10y agoI consider homoiconicity to fit into the "macros". Other languages have macros, but they are at maximal power in the Lisps. On the one hand, it doesn't seem to me to be strictly necessary to be "homoiconic" for macros to work. On the other hand, it seems like non-homoiconic languages always end up mitigating the power somehow. Maybe it's just correlation rather than causation, but unless you're planning to write a new language that doesn't matter much in practice.
- nickpsecurity 10y ago"Lisp is about empowering the programmer, and building on that empowerment. Haskell is about restricting the programmer, and then building on those restrictions." Best, briefest way I've seen it described. I think that's how I'll start describing it, too.
- collyw 10y agoIts the Perl versus Python argument of functional programing languages.
- nickpsecurity 10y agoCreative. Yeah, I can see that.
- qwertyuiop924 10y ago>macros, which you really shouldn't make much use of in the more modern understanding Well, only if you're stuck with a broken macro system (cough cough Common Lisp cough cough). Here in scheme, we have er-macros and sc-macros, as well as syntax-rules. Hygene matters, and procedural macros rock, although you want declarative for the simple things. pg really made the wrong call on that, and it will probably haunt arc for years to come.
- jerf 10y agoAs everyone knows, Scheme is a Lisp 2 out of 7 days of the week + state holidays. Where I am, it's one of those days. YMMV depending on your relationship to the International Date Line.
- qwertyuiop924 10y agoScheme is a lisp all 7 days. What makes you think otherwise?
- jerf 10y agoTake it up with these people: https://encrypted.google.com/search?hl=en&q=%22scheme%20is%20not%20lisp%22 https://encrypted.google.com/search?hl=en&q=%22scheme%20is%2... I haven't got a horse in this race.
- qwertyuiop924 10y agoYeah, no. Scheme is as much a lisp as eulisp, interlisp, common lisp, BBN lisp, maclisp, Racket (which isn't the same thing as scheme), or any other incompatible lisp. It has the macros, it has the syntax, it has the datastructures. It doesn't have nil/false equivalence, but that's not a core aspect of lisp.
- fsck--off 10y agoLook at this thread for more details: https://news.ycombinator.com/item?id=6068732 https://news.ycombinator.com/item?id=6068732
- retrogradeorbit 10y ago> But if you learned, say, Python in school, the list comes back to "macros, which you really shouldn't make much use of in the more modern understanding, and a bigger focus on recursion". Less likely to make you pass out in awe. It really depends which Lisp you are talking about. If this is true then why do I find Clojure so many orders of magnitude more powerful, more reasonable and more pragmatic than Python. I've done Python for a decade, but now days I would choose Clojure over it every single time. Clojure over Python is so very much more than just macros. The default data structures are far superior, the time abstractions are fantastic, the concurrent and parallel programming features are better, the asynchronous support is miles ahead and it has parts you can use that just don't exist at all in Python like core.logic and core.match. I also think the whole is greater than the sum of its parts. Yes, a lot of this stuff exists in Python, but not in the same elegant and idomatic way. In Python the onus is on you to get it right. And one rarely does. Clojure however steers you in the right direction, making it idomatic. When your code is right, it looks right. And when your code is wrong, it looks wrong.