Rough Haskell and OCaml comparison,
was Re: novice's notes on learning OCaml
Shae Matijs Erisson
shae at ScannedInAvian.com
Tue Mar 13 19:26:18 EDT 2007
"Richard Underwood/Uhtenwoldt" <ru at river.org> writes:
>> A simpler syntax with fewer levels of precedence. Maybe writing OCaml in
>> S-expressions would be going too far, or maybe not. Clearly this would
>> make it effectively a different language.
> Do you know enough about Haskell to have a definite opinion about its
> (I think it is basically good though I would reduce the number of
> levels of operator precedence a lot.)
Haskell has been my primary fun language for about seven years,
and my primary employment language for about half a year.
In my opinion, Haskell has advantages over OCaml in syntax, typeclasses, and
community. I'd be happy to elaborate on any of these points if there's any
OCaml has advantages over Haskell in ability to decrease execution time without
much effort, but at the expense of abstraction.
In short, if you know C, you can make a roughly equivalent OCaml program that's
anywhere from not quite as fast to faster than any given C program.
Another difference is that OCaml allows mutable variables, and Haskell forbids
OCaml is a strict language, Haskell is non-strict according to the standard,
and most implementations use full laziness.
Haskell is, in my opinion, better at abstractions than OCaml, but at the
expense of requiring mental whole program analysis in order to understand
non-strict evaluation. Also in my opinion, mutable variables require more whole
program analysis than non-strict evaluation, but I don't know how many people
agree with me.
I'd roughly say that OCaml is the vi, and Haskell the emacs of FP :-)
I do not think that either language is *better*. I instead think that people
should try both and decide what fits their own approach to life.
I've tried to teach people autodidactism, | ScannedInAvian.com
but it seems they always have to learn it for themselves.| Shae Matijs Erisson
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 188 bytes
Desc: not available
Url : http://lists.canonical.org/pipermail/kragen-discuss/attachments/20070313/cadbaf5d/attachment.pgp
More information about the Kragen-discuss