From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 01924BC6B for ; Mon, 9 Jul 2007 13:28:10 +0200 (CEST) Received: from ipmail03.adl2.internode.on.net (ipmail03.adl2.internode.on.net [203.16.214.135]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l69BS8g9029849 for ; Mon, 9 Jul 2007 13:28:10 +0200 X-IronPort-AV: E=Sophos;i="4.16,516,1175437800"; d="scan'208";a="113600676" Received: from ppp121-44-3-31.lns4.syd7.internode.on.net (HELO [192.168.1.201]) ([121.44.3.31]) by ipmail03.adl2.internode.on.net with ESMTP; 09 Jul 2007 20:58:07 +0930 Subject: Re: [Caml-list] Camlp4s 4.02 From: skaller To: Joel Reymont Cc: Caml List In-Reply-To: References: <20070709094028.GB9408@yquem.inria.fr> Content-Type: text/plain Date: Mon, 09 Jul 2007 21:28:05 +1000 Message-Id: <1183980485.26391.15.camel@rosella.wigram> Mime-Version: 1.0 X-Mailer: Evolution 2.10.1 Content-Transfer-Encoding: 7bit X-Miltered: at concorde with ID 46921BC8.002 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; camlp:01 0100,:01 camlp:01 syntax:01 parser:01 rebuilt:01 translated:01 variants:01 syntax:01 ml':01 rtfm:01 ocaml:01 compiler:01 ocamldoc:01 ocamldep:01 On Mon, 2007-07-09 at 10:58 +0100, Joel Reymont wrote: > This is most awesome, I think. With all due respect to the developers > of the "new" camlp4, I wonder if it will now join the revised > syntax :-). > > What do you think? Dypgen based on the fly extensions will replace both :) FYI .. the Felix programming language grammar is now loaded from the library as text. This is made possible by two technologies: * Dypgen is an extensible GLR parser, which allows new grammar productions to be added to a grammar during parsing. The LR0 kernel is rebuilt when this happens. The current encoding is very fast. * OCS Scheme is used to encode the user actions as text which is executed to create an Ocs_types.sval or Scheme value (aka s-expression). The s-expressions are translated to the usual Felix AST terms built with polymorphic variants. The syntax definitions and extensions are properly scoped by the grammar itself. Both camlp4's suffer from the weakness of being separated from the user program text. This is a software engineering disaster, because it means an '*.ml' file can't just be compiled. You have know, through magic, ESP, or RTFM which preprocessor has to be used to compile it (and you have to make sure you compiled that too). At the very least, Ocaml should be modified to add a new statement/directive such as: syntax fred;; which tells the reader and the compiler which syntax extension has to be used to interpret the rest of the program. That way it might be loaded automatically, and, programs like ocamldoc and ocamldep can proceed without the user having to keep track of the language of every file separately from the file itself. -- John Skaller Felix, successor to C++: http://felix.sf.net