Re: Haskell or OCAML?

Joachim Durchholz <>
11 Mar 2004 12:46:47 -0500

          From comp.compilers

Related articles
Haskell or OCAML? (Chris F Clark) (2004-03-06)
Re: Haskell or OCAML? (Joachim Durchholz) (2004-03-11)
| List of all articles for this month |

From: Joachim Durchholz <>
Newsgroups: comp.compilers
Date: 11 Mar 2004 12:46:47 -0500
Organization: Oberberg Online Infosysteme
References: 04-03-021
Keywords: OOP
Posted-Date: 11 Mar 2004 12:46:47 EST

Chris F Clark wrote:

> Not, to start a functional language war, but I'm curious as to some
> recommendations from this group as to whether I should learn Haskel or
> OCAML first as a functional language given that my interest is
> learning how such languages influence compiler design, in particular
> how higher order functions and pattern matching make building
> compilers easier.

That's a FAQ on comp.lang.functional :-)

The uncontroversial answer is: learn both, they are different enough
that it's worth the time.

After that, answers tend to get controversial.

My personal impression is that Haskell is both more radical and more
elegant. I found this particularly striking with its syntax
(minimalistic overhead and maximal expressiveness, without getting
awkward) and the way it does real-world interactions (which is an entire
story that's too long to fit on the margin of this post).

If you feel comfortable with radical departures from the usual way of
doing things, Haskell is the more rewarding experience.
If you like to learn new things one by one, OCaml is probably far easier
to adapt to.

I'd recommend SML instead of OCaml though, at least if you're doing this
for pedagogical purposes. OCaml offers too much in the way of OO stuff,
and OO would be just an irrelevant distraction. It may also be
interesting to see SML in action - I discovered just today that the ACAP
part of the Cyrus IMAP server is written in SML (I don't know what ACAP
is though... just quoting what I found on the Cyrus WWW pages). Looking
into a mail server component is probably giving a better overall
impression of a programming language that concentrating just on compiler
issues (but YMMV).
(The strong point of OCaml is speed, not necessarily simplicity to learn
and use.)

Parsing combinators can and have been written in all of them.
Actually there shouldn't be any serious differences between the
languages, so your particular interest doesn't predetermine your choice.


Currently looking for a new job.

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.