From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 55FD0BB83 for ; Thu, 20 Jul 2006 22:42:12 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.6/8.13.6) with ESMTP id k6KKgBIH005161 for ; Thu, 20 Jul 2006 22:42:11 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id WAA09617 for ; Thu, 20 Jul 2006 22:42:11 +0200 (MET DST) Received: from out4.smtp.messagingengine.com (out4.smtp.messagingengine.com [66.111.4.28]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id k6KKg6Hf030153 for ; Thu, 20 Jul 2006 22:42:10 +0200 Received: from frontend3.internal (frontend3.internal [10.202.2.152]) by frontend1.messagingengine.com (Postfix) with ESMTP id 1CF05D916BD; Thu, 20 Jul 2006 16:42:05 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by frontend3.internal (MEProxy); Thu, 20 Jul 2006 16:42:07 -0400 X-Sasl-enc: vgpUhobDfSy4relVwK2FFD+FY33BZE84a0NolTNLOKF+ 1153428127 Received: from [172.16.251.195] (burnham.ljcrf.edu [192.231.106.2]) by mail.messagingengine.com (Postfix) with ESMTP id 201BF124; Thu, 20 Jul 2006 16:42:05 -0400 (EDT) Date: Thu, 20 Jul 2006 05:40:38 -0700 (PDT) From: Martin Jambon X-X-Sender: martin@munge To: =?ISO-8859-1?Q?B=FCnzli_Daniel?= Cc: Eric Breck , caml-list@inria.fr Subject: Camlp4 mysteries (was Re: On language extensions (was Re: [Caml-list] global record)) In-Reply-To: <60FD7628-7F4E-4765-88AD-B3AB7DA987D0@epfl.ch> Message-ID: References: <51E3580C-02A1-4344-A5AA-862B580015F1@cs.cornell.edu> <60FD7628-7F4E-4765-88AD-B3AB7DA987D0@epfl.ch> MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-119901243-1153396180=:19078" Content-ID: X-j-chkmail-Score: MSGID : 44BFEAA3.000 on nez-perce : j-chkmail score : XXX : 0/20 3 X-j-chkmail-Score: MSGID : 44BFEA9E.001 on concorde : j-chkmail score : XXXX : 0/20 4 X-Miltered: at nez-perce with ID 44BFEAA3.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 44BFEA9E.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; camlp:01 bunzli:01 camlp:01 delimited:01 syntax:01 syntax:01 rewriting:01 ocaml:01 clashes:01 metaocaml:01 ocaml:01 u-tokyo:01 oiwa:01 1977:98 wrote:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.7 required=5.0 tests=DATE_IN_PAST_06_12, FROM_ENDS_IN_NUMS autolearn=disabled version=3.0.3 This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-119901243-1153396180=:19078 Content-Type: TEXT/PLAIN; CHARSET=iso-8859-1; format=flowed Content-Transfer-Encoding: 8BIT Content-ID: On Thu, 20 Jul 2006, Bünzli Daniel wrote: > I'm sorry to say that but I regard (maybe out of ignorance) camlp4 as very > low level and brittle tool (not to say hack). An obvious proof of this to me > is the composition problem which is according to previous messages is not > solved by camlp4. In theory the system of quotations allows you to use as many quotation expanders as you want. Quotations are well delimited and do not interfere with each other, but look a bit ugly and are restricted to exprs and patts. Otherwise it's possible to define well-disciplined syntax extensions. For example, if each new syntax construct (new rule) is forced to start with a unique, registered keyword and end with "end", then different syntax extensions that follow this rule should play well together. Deleting or rewriting existing rules would of course be forbidden. And tools like Declare_once [1] should become builtins. So if you take my favorite syntax extension (micmatch), you would need to create a new keyword, let's say "mm": match "Hello World!" with / "Hello"~ blank+ (alnum+ as user) / -> Some user | _ -> None could become mm match "Hello World!" with mm "Hello"~ blank+ (alnum+ as user) end -> Some user | _ -> None end To the OCaml development team: Would such a convention make sense? Could there be special restricted EXTEND statement that only accepts that kind of rules, and registers the keywords to avoid unexpected clashes between extensions that try to use the same leading keyword? It would be really nice to have official guidelines on how to develop clean syntax extensions, if not automatic enforcement. That's all I can say, I don't have time to spend playing with the new Camlp4 or trying to understand what MetaOCaml is about. Any official word about the metaprogramming issues in OCaml would be appreciated! I am sorry to say that, but there is way too much mystery floating around Camlp4. A web page that presents a roadmap for the development of OCaml language and tools including Camlp4 would be much appreciated. Martin [1] Declare_once: look for it at http://www.yl.is.s.u-tokyo.ac.jp/~oiwa/en_US.ISO-8859-1/pub/caml/regexp-pp-1.0.0/README.match-regexp -- Martin Jambon, PhD http://martin.jambon.free.fr --8323329-119901243-1153396180=:19078--