From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA07039; Thu, 13 Mar 2003 19:37:28 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id TAA07237 for ; Thu, 13 Mar 2003 19:37:27 +0100 (MET) Received: from viola.sinor.ru (viola.sinor.ru [217.70.106.9]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id h2DIbQX21618 for ; Thu, 13 Mar 2003 19:37:26 +0100 (MET) Received: from sibnet.ru (tlg5-ppp10.sibnet.ru [217.70.116.10]) by viola.sinor.ru (8.12.8/8.12.3) with SMTP id h2DIaVdu025094 for ; Fri, 14 Mar 2003 00:36:43 +0600 Received: by sibnet.ru id m18tXWL-001EpZC; Fri, 14 Mar 2003 00:33:37 +0600 (NOVT) Date: Fri, 14 Mar 2003 00:33:36 +0600 From: Max Kirillov To: caml-list@pauillac.inria.fr Subject: [Caml-list] Re: Haskell-like syntax Message-ID: <20030314003336.D748@max.home> Mail-Followup-To: caml-list@pauillac.inria.fr References: <005d01c2e76f$92d0f8b0$2713f9ca@WARP> <3E6DDAFC.19000.44771B6@localhost> <20030313024153.B748@max.home> <200303122136.12111.oleg_inconnu@myrealbox.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <200303122136.12111.oleg_inconnu@myrealbox.com>; from oleg_inconnu@myrealbox.com on Wed, Mar 12, 2003 at 09:36:11PM -0500 X-Sender: Max X-Spam: no; 0.00; kirillov:01 haskell-like:01 oleg:01 haskell:01 camlp:01 ugliness:01 reuse:01 fstream:01 damned:01 monads:01 hacks:01 ocaml:01 token:01 trading:98 syntax:02 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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. -- Max ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners