2 ms·
I learned scheme first, then haskell, then (now) clojure. I think haskell is best for teaching functional programming because it's purely functional and puts fo
by adrusi 14y ago
I learned scheme first, then haskell, then (now) clojure. I think haskell is best for teaching functional programming because it's purely functional and puts focus on that aspect rather than on performance benefits of being functional. after ~1 year with it, I've decided that haskell, while great, is not for me, and I'm switching over to clojure. Clojure is very nice as a language; what it lacks in terms of a type system it makes up for with the presence of macros.
However, I don't think that clojure is quite as great for teaching functional programming, because it is an eager language unless you explicitly tell it to be lazy exactly where you want it to be, so it doesn't have the performance optimizations that haskell has with recursion (as opposed to tail-call recursion) and it's therefore discouraged to not use tail-call recursion.
Now that's my recommendation for a first functional programming language. For a first language in general, I'd recommend the reverse because with clojure you can actually start doing something practical as soon as you get started, where with haskell it takes a while to get to that point.
But the installation process is different with the two. With clojure, the language is designed around being used with a build system as part of java tradition, which means that you normally can't just type `clj` and get a REPL (at least not with the official distribution). Generally the best way to go about doing that is to install leiningen and make a new project and do `lein repl` in the project directory.
In Haskell on the other hand (with the Haskell platform installer) you can just run the installer and type `ghci` and get a REPL. If you want to run a Haskell program to test it, it's just `runhaskell file.hs` and to compile, it's as simple as `ghc --make file.hs`. But when things get more complicated, even slightly so, Haskell can be an incredible pain to deal with (in terms of compiling and such) whereas clojure, being designed around build systems for large project, scales up just fine.