[Haskell-cafe] Haskell vs OCaml

Hal Daume III hdaume at ISI.EDU
Fri Dec 23 19:46:48 EST 2005


You'll probably get a lot of different answers.  I think the major 
difference is the notion of encapsulation used by each.  Haskell has type 
classes and O'Caml has structures/functors and (OO) classes.  I personally 
find type class much nicer.  Additionally, I think Haskell's syntax is 
easier on the eyes and the libraries are much more well established.

That said, I use O'Caml for all of my non-Perl coding.  Why?  Because I 
need lots of arrays and though Haskell does support them, the lack of 
syntactic sugar makes it very inconvenient.  Second, lack of loop support, 
which I can live without.  Finally, it's slower.  I would forgive the last 
(it can be made faster if you use unboxed arrays and so on) if the first 
two were fixed.

(Of course, which is better depends strongly on your application.  I do a 
lot of statistical machine learning stuff, which requires processing of 
huge arrays and matrices, lots of loops and lots of funny math 
calculations.)

On Sat, 24 Dec 2005, Daniel Carrera wrote:

> Hi all,
> 
> Okay, I've been studying Haskell for a few days and I think I have a 
> feel for the language. I completted a course, and wrote a Revers Polish 
> Notation calculator.
> 
> Now that I sort of understand Haskell, I was hoping someone could give 
> me an opinion on OCaml from a Haskell POV. Both are functional and have 
> fairly clear syntax. OCaml is supposed to be very fast, and Haskell 
> perhaps is not. Besides that, what else could you say about them? What 
> would make someone prefer one over the other?
> 
> Any thoughts, opinions and comments would be most appreciated.
> 
> Thanks!
> 
> Cheers,
> Daniel.
> 

-- 
 Hal Daume III                                   | hdaume at isi.edu
 "Arrest this man, he talks in maths."           | www.isi.edu/~hdaume



More information about the Haskell-Cafe mailing list