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 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 0BA1DBBAF for ; Thu, 23 Apr 2009 04:18:17 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhEHAC9t70mM9zwYWmdsb2JhbACWOQEiIgSnZIguiE2DdAY X-IronPort-AV: E=Sophos;i="4.40,234,1238968800"; d="scan'208";a="38897630" Received: from bowser.eecs.harvard.edu (HELO mail.eecs.harvard.edu) ([140.247.60.24]) by mail4-smtp-sop.national.inria.fr with ESMTP; 23 Apr 2009 04:18:01 +0200 Received: by mail.eecs.harvard.edu (Postfix, from userid 33141) id CA58F1A3C77; Wed, 22 Apr 2009 22:17:58 -0400 (EDT) Date: Wed, 22 Apr 2009 22:17:58 -0400 From: Geoffrey Mainland To: Jon Harrop Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] quasiquoting: 3 parsers for camlp4 vs 1 for haskell? Message-ID: <20090423021758.GE34560@eecs.harvard.edu> References: <200904230019.09216.jon@ffconsultancy.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200904230019.09216.jon@ffconsultancy.com> User-Agent: Mutt/1.4.2.3i X-Spam: no; 0.00; parsers:01 camlp:01 haskell:01 0100,:01 camlp:01 parser:01 syntax:01 ocaml:01 parsers:01 afaict:01 syntax:01 translating:01 ocaml:01 haskell:01 mainland:98 On Thu, Apr 23, 2009 at 12:19:09AM +0100, Jon Harrop wrote: > 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. > > > each generating different representations of the same concrete syntax." > > That has never been true. > > > Can someone shed light on how, where and why three different > > parsers are required for camlp4? > > I've CC'd the author. Perhaps he can shed some light on this. I actually spoke with Nicolas Pouillard about this at the workshop, and he informed me that his rewrite of camlp4 for the 3.10 release included a facility for translating a value into an OCaml AST representing that value, so yes, that statement is now incorrect. I think Jake Donham's reply to Joel's message of 4/15 made this clear and even helpfully pointed to some code. As for my work, I hope that anyone reading the paper will find the technique I used to provide this functionality in the Haskell implementation of quasiquotation both elegant and easy to understand. Geoff