caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Wojciech Meyer <wojciech.meyer@googlemail.com>
To: Gerd Stolpmann <info@gerd-stolpmann.de>
Cc: bob zhang <bobzhang1988@gmail.com>,
	 Alain Frisch <alain@frisch.fr>,
	 caml-list@inria.fr
Subject: Re: [Caml-list] Re: Syntax extensions without Camlp4
Date: Thu, 31 May 2012 19:03:15 +0100	[thread overview]
Message-ID: <wfobp41b4s.fsf@gmail.com> (raw)
In-Reply-To: <1338485339.17140.120.camel@thinkpad> (Gerd Stolpmann's message of "Thu, 31 May 2012 19:28:59 +0200")

Gerd Stolpmann <info@gerd-stolpmann.de> writes:

> Am Donnerstag, den 31.05.2012, 12:01 -0400 schrieb bob zhang:
> I guess you are missing Alain's point here. He suggests to use normal
> pattern matching directly on parsetrees, as in
>
> match expr with
>  | Pexp_ident id -> Pexp_ident (tranform id)
>  | Pexp_contant c -> Pexp_constant c
>  | ...
>
> instead of using camlp4 syntax quotations (no <<...>> stuff for syntax
> manipulation anymore).

I admit quotations are *way* better to construct the code, they are
syntax aware but also reassemble string manipulation at the same
time. If somebody has generated some more serious program using
quotations then she can't stand using normal way by constructing via the
data constructors. I can compare, because I have used both ways for the
same project. Of course normal ASTs have it's wide applications, what is
shown above is a transform, and not strictly a code generation - usually
I have intermediate AST on the left hand side pattern match and on the
right hand side quotations. So I can't say quotations are not useful,
they are quite much. If the quotations could be as lightweight as
brackets-escape notations of MetaOCaml it would be brilliant. (I'm
really talking about code generation - and not extending the syntax).

Please see [1].

I'd support the idea of having quotations for the parse trees.

-- 
Wojciech Meyer
http://danmey.org

[1] http://www.eecs.harvard.edu/~mainland/ghc-quasiquoting/mainland07quasiquoting.pdf

  reply	other threads:[~2012-05-31 18:03 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-27 15:06 [Caml-list] " Alexandre Pilkiewicz
2012-05-27 16:53 ` [Caml-list] " Hongbo Zhang
2012-05-27 18:04   ` Daniel Bünzli
2012-05-27 18:18     ` Hongbo Zhang
2012-05-27 19:01       ` Daniel Bünzli
2012-05-27 22:43         ` Wojciech Meyer
2012-05-28  9:35           ` Daniel Bünzli
2012-05-28  9:59             ` Gabriel Scherer
2012-05-30 14:45               ` Hongbo Zhang
2012-05-28 11:17             ` Wojciech Meyer
2012-05-28 15:52             ` Jeffrey Scofield
2012-05-27 18:19     ` Hongbo Zhang
2012-05-28  8:17     ` Paolo Donadeo
2012-05-30 12:41   ` Alain Frisch
2012-05-30 13:18     ` Markus Mottl
2012-05-30 13:37     ` Dan Bensen
2012-05-30 14:16       ` Hongbo Zhang
2012-05-30 14:23         ` Paolo Donadeo
     [not found]           ` <20120531081913.GA26742@securactive.lan>
2012-05-31 12:26             ` Paolo Donadeo
2012-05-31 12:38               ` Anil Madhavapeddy
2012-05-31 12:40                 ` Anil Madhavapeddy
2012-05-31 12:46                   ` Yaron Minsky
2012-05-31 12:47                   ` Gabriel Scherer
2012-05-31 22:08                 ` Paolo Donadeo
2012-05-30 14:14     ` Hongbo Zhang
2012-05-31 12:59       ` Alain Frisch
2012-05-31 13:21         ` Dmitry Grebeniuk
2012-05-31 14:30           ` Daniel Bünzli
2012-05-31 16:01         ` bob zhang
2012-05-31 17:28           ` Gerd Stolpmann
2012-05-31 18:03             ` Wojciech Meyer [this message]
2012-05-31 18:32               ` Gerd Stolpmann
2012-05-31 18:32             ` Hongbo Zhang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=wfobp41b4s.fsf@gmail.com \
    --to=wojciech.meyer@googlemail.com \
    --cc=alain@frisch.fr \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=info@gerd-stolpmann.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).