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=2.0 required=5.0 tests=AWL,DNS_FROM_RFC_POST, SPF_NEUTRAL autolearn=disabled version=3.1.3 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 21244BBAF for ; Thu, 23 Apr 2009 16:54:39 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjgHACMe8EnRVduwdWdsb2JhbACWCT8BDAoLBxGnKoEJkQYBAwEDg3IG X-IronPort-AV: E=Sophos;i="4.38,431,1233529200"; d="scan'208";a="28169336" Received: from mail-ew0-f176.google.com ([209.85.219.176]) by mail1-smtp-roc.national.inria.fr with ESMTP; 23 Apr 2009 16:54:38 +0200 Received: by ewy24 with SMTP id 24so566580ewy.27 for ; Thu, 23 Apr 2009 07:54:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:content-type:cc:subject:from :to:references:in-reply-to:date:message-id:user-agent; bh=t74hV9VpP9zz6J3IXADr9D6x/jIlPlXZm8WtdEmsLYs=; b=SAi4qmZRtC2po+8MhFJo+eXPe13EyHlxRpHrJMP+UuRxi3ENIwC4cg77yfofbJrnbh poJB5ifJspwPZnz0UtPctUUcnneokgKm2ILidmxIEEsCf5ATBOi5dOgmHELWxXwCNZEi qnjMXOpCYFh4zM9uZo0GBP9CDQU24Soudrpb0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=content-type:cc:subject:from:to:references:in-reply-to:date :message-id:user-agent; b=JmiyvvH5JPbkGlLuYmohyQ4X7wMXx95Orza0U7ImNLA/8J6BEUvIYWQD4z1aypbanZ K/UDbu98k+mrnq0yotAXxoUVQy5kpBV4fmq5Pm1OWgzJZcR+T3nSOFHr2Sq1e9FDpD6n ngM/oQeKFHUwdSsb9dKkFwAijxn7rIHF5bYvQ= Received: by 10.210.22.16 with SMTP id 16mr64466ebv.74.1240498478521; Thu, 23 Apr 2009 07:54:38 -0700 (PDT) Received: from localhost (home.feydakins.org [82.229.164.236]) by mx.google.com with ESMTPS id 7sm182499eyg.7.2009.04.23.07.54.37 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 23 Apr 2009 07:54:37 -0700 (PDT) Content-Type: text/plain; charset=UTF-8 Cc: caml-list , mainland Subject: Re: [Caml-list] quasiquoting: 3 parsers for camlp4 vs 1 for haskell? From: Nicolas Pouillard To: Jon Harrop References: <200904230019.09216.jon@ffconsultancy.com> In-Reply-To: <200904230019.09216.jon@ffconsultancy.com> Date: Thu, 23 Apr 2009 16:53:28 +0200 Message-Id: <1240497508-sup-5770@ausone.local> User-Agent: Sup/git X-Spam: no; 0.00; parsers:01 camlp:01 haskell:01 camlp:01 parser:01 syntax:01 ocaml:01 parsers:01 afaict:01 ocaml-like:01 syntax:01 parser:01 ocaml:01 2009:98 2009:98 Excerpts from Jon Harrop's message of Thu Apr 23 01:19:09 +0200 2009: > On Friday 17 April 2009 19:24:31 Joel Reymont wrote: > > From the quasiquoting paper by Geoffrey Mainland [1], page 7: > > > > "The major advantage of our approach over that of camlp4 > > is that we demonstrate how to use generic programming > > to reuse a single parser to parse quasiquoted patterns, > > quasiquoted expressions and plain syntax that does not > > include antiquotes. Because OCaml does not support generic > > programming out of the box, > > I have no idea what he meant by this. > > > in camlp4 this would require three separate parsers, > > AFAICT, that was not true when he wrote it (Sept 2007) and is not true today. There was indeed three different parsers for OCaml-like syntax in the old camlp4. Actually there was one classical parser for the official/original OCaml syntax but this one was not embeddable in quotations. There was also two parsers for the revised syntax one being the classical one and the other being for quotations. > > each generating different representations of the same concrete syntax." > > That has never been true. We are talking about quotations here, and I can confirm that the two parsers for the revised syntax where generating to different representations of the concrete syntax. Example (simplified): f 42 => App (Var "f") (Int "42") <> => App (App (Con "Var") (Str "f")) (App (Con "Int") (Str "42")) The new version of camlp4 use only one grammar for the revised syntax (instead of two) and a grammar extension for the official/original syntax. Best regards, -- Nicolas Pouillard