Which functional programming language should I choose to learn?
Having programmed in C++ for several years and having read HN for several months, I would like to learn a functional programming language to expand/change the way I think about writing programs. Which functional programming language should I choose? Python, Ruby, Haskell, others? It would be nice to have decent library support so that I can actually write a web based product using it and host it somewhere :). Please advice
9 comments
[ 2.8 ms ] story [ 30.6 ms ] threadhttp://en.wikipedia.org/wiki/Rust_%28programming_language%29
When people talk about "functional languages", they mean things like Haskell, OCaml & other ML-ish languages, Scala, F#, and the various dialects of Lisp (EDIT: and, yes, Rust).
If you really want to expand/change the way you think, then I'd say Haskell is what you want. As for libraries, there is a huge amount of work going into Haskell libraries & bindings for existing libraries. I'm not really able to judge whether any of this work is any good, however.
Scala and Clojure (Lisp dialect) have also been getting a lot of attention lately. They both run on the JVM, and so should have excellent library support.
Wait to see how many people here suggest Ruby or Python, or JavaScript, though.
If you want to take the jump straightaway - I will suggest going for Erlang. Erlang has plenty of nice web libraries like mochiweb, nitrogen etc. using which you can actually write a web based product.
Erlang can be sort of considered a "Scheme with syntax". However, it is also somewhat weird, and if you're just starting with a functional language, you might as well go for Scheme.
I personally don't know that I'd recommend Haskell as a starting functional language. If you want to learn Haskell, I might suggest stating with Erlang as a baby untyped Haskell, and then move up to Haskell.
Also, Javascript is more functional than is generally realized, however, it's functional flavor may be more obvious after you have been exposed to an explicitly functional language.
One last thought, if you are interested in Web programming, Clojure is a functional flavored version of Lisp that runs on the JVM, and has a web framework called Compojure that seems well regarded.