4 ms·
If the goal is to learn to think functionally, you should concentrate your attention on one or a couple of the big old ones and avoid the Java hybrids until you
by fusiongyro 14y ago
If the goal is to learn to think functionally, you should concentrate your attention on one or a couple of the big old ones and avoid the Java hybrids until you're more comfortable.
Choosing which one is a matter of personal preference. Erlang is the best choice if you're interested in concurrency and distributed programming. It's also in a sweet spot where variables are bound once, which forces you to change the way you think. I consider this more important than purity for learning.
Haskell is probably the biggest paradigm shift. I use it a lot and love it. It really does change the way you think, but it is also the steepest learning curve.
Of all the Lisps, Scheme is the simplest and tends to be used functionally more often than Common Lisp. There is an incredible wealth of resources for people learning Scheme, but especially The Little Schemer and Structure and Interpretation of Computer Programs (SICP). I have never made much progress in my copy of SICP, but I got a lot out of the Little Schemer. I said to avoid JVM languages but Clojure is the most modern Lisp, and incorporates a lot of modern functional programming idioms, so it can sometimes have a Haskellish flavor, and it doesn't make circumventing FP all that easy. It's probably the best Lisp of today.
Standard ML and OCaml are both good if it looks to you like Haskell goes too far but in the right direction. OCaml is considered more pragmatic; it's also more widely available and benefits from being a single-implementation language. Standard ML is arguably a more beautiful language, but it suffers from low library availability. Both will encourage functional-style programming, but both provide a fair number of escape hatches. For example, they're not pure and they both have "refs" that let you circumvent variables-as-bindings. But they encourage the style.
I tried many times with Lisp and eventually concluded it just wasn't for me, and Haskell is a better fit. I personally recommend looking at Erlang, Clojure and Haskell, and just throwing yourself into whichever one of them looks "cool" to you. If the language feels unpleasant to you, there's no point in trying to force yourself to go further, but if it seems fun to you, you'll make progress without as much effort.
- tedchs 14y agoThis is a great overview, thanks for posting!
- bitcartel 14y agoHave you tried (and if so, do you like) F# ? http://fsharp.org/ http://fsharp.org/
- fusiongyro 14y agoI have a positive opinion of it but I haven't used it myself. I would imagine it deserves the same caveat as JVM hybrids do: having an easy escape hatch may ease the learning curve, but it can also extend the time it takes to become proficient.
- vilya 14y agoOne thing I'd add is that Haskell has by far the best tutorial I've ever encountered for any programming language in the form of Learn You A Haskell For Great Good: http://learnyouahaskell.com/ http://learnyouahaskell.com/ That alone is a good enough reason to try out the language, in my opinion.