Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] OCaml popularity
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2003-03-13 (18:37)
From: Max Kirillov <max630@m...>
Subject: [Caml-list] Re: Haskell-like syntax
On Wed, Mar 12, 2003 at 09:36:11PM -0500, Oleg wrote:
> While we are on the subject of Haskell, has anyone thought about creating a 
> Haskell-like syntax for O'Caml? I don't know Haskell, but its syntax appeals 
> to me very much.
> Oleg

Not with camlp4. First, it does not allow '\' as a token. Second, it
does not care for whitespaces to do layout parsing.

Even trading the above (very nice) things, camlp4 is based on Stream,
which cannot support backtrack. This leads to the "keyword cancer" and
the overall syntactic ugliness, which holded be away from ocaml for a
long time. The nice Haskell syntax is more difficult to parse and, I'm
afraid, very much more difficult to extend in camlp4 way.

I'm sure, one could reuse some things of camlp4 (namely, quotations and
maybe the Fstream library) to produce the parser you want.

But, you know, haskell is nice not only due to the syntax. It has many
features which ocaml does not. Moreover, I think, that without
things like lazy computaion (and binding), very democratic patterns, type
classes, type support for purity (the damned monads) seeing just the
syntax would just make me anger:).

Talking about the single thigs: at the beginning of my way into ocaml, I
did some camlp4 hacks. For example, that was "where" keyword support
(much more powerful than in revised syntax) and some support for "from
top to bottom" style of sources. If you interested, I could post them.


To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: