| I disagree completely. It is true that a few years ago, OCaml was more "practical" then haskell. It was faster and had more libraries. But today haskell is superior to OCaml in nearly all aspects. As a language, haskell has always been cleaner and more elegant. It has simpler syntax, a more powerful type system, lazy evaluation, and in general more features. In terms of performance, haskell has caught up with OCaml and exceeded it. The leading haskell compiler(GHC) has been adding in optimizations one after another the past few years. Deforestation, pointer tagging, parallel garbage collection, and other techniques from various research papers. GHC is a top quality professional compiler built by a bunch of geniuses. Haskell also has several implementations and compilers(GHC, Hugs, yhc, nhc, jhc...) while OCaml has only a single implementation. In terms of tool support, haskell has a debugger(ghci debugger), a profiler(ghc) an excellent documentation generation tool(haddock), and a standard build system(cabal). These are all superior to their OCaml equivalents(where they exist at all: OCaml build systems usually are a mess of makefiles or autohell) Haskell is catching up to OCaml in the number of libraries available. Haskell now has a CPAN-like website called hackage with hundreds of libraries for all application domains (see the list: http://hackage.haskell.org/packages/archive/pkg-list.html ). Libraries can be downloaded and installed with haskell's build system using a single command, with dependencies also automatically taken care of. The haskell standard library is also a lot better then OCaml's. OCaml has two different incompatible list types(one lazy and one strict). OCaml's file handles can be either written to or read from, not both. (It's not possible to open a file for RW in OCaml). And OCaml infamously requires special syntax for doing arithmatic with floating point numbers(1 + 2 for integer, 3.0 +. 4.0 for floating point). In terms of community I think that both languages are about equal. Haskell has active and beginner-helpful mailing lists and an IRC channel (one of freenode's most crowded). Overall, I believe that Haskell is more "practical" then OCaml in nearly every domain. The only thing where OCaml might be preferable is high performance numeric stuff. But this might not be the case for much longer when the haskell GHC compiler will soon get it's new native code generator. Haskell popularity has been exploding in the past few years, with tons of new libraries and books. There have always been myths about haskell that have caused it to have a perception of being impractical, kind of similar to lisp. But the truth is that haskell is a practical language, and depending on what you need to do, it can even compete with other practical languages like java and python. |
> OCaml build systems usually are a mess of makefiles or autohell
VERY true. OCamlMakefile (http://www.ocaml.info/ocaml_sources/ocaml-make-6.28.1/README) helps, somewhat.
> In terms of community I think that both languages are about equal.
Really? I've gotten the impression that the Haskell community is larger, or at least writes quite a bit more. (And dons on #haskell is really helpful.)
OTOH, OCaml seems to be more portable. Porting GHC to a new platform seems quite a bit more difficult than porting OCaml; its separation of byte- and native compilation helps considerably. (This may or may not be as important to you.) Also, OCaml doesn't need to do as many advanced things for optimization.
All other things aside, I still think that Haskell is probably easier to learn if you are familiar with OCaml first (which was the original question): Haskell requires you to understand several new ideas upfront before you can do much of anything, whereas in OCaml you can pick up functional programming and how to work with the type system before learning to work with lazy evaluation and monads / purity. (You can also use monads in OCaml, Scheme, etc., of course.)