caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Jacques Carette" <carette@mcmaster.ca>
To: <caml-list@inria.fr>
Subject: RE: [Caml-list] partial eval question
Date: Mon, 27 Oct 2003 15:08:36 -0500	[thread overview]
Message-ID: <002d01c39cc6$1ac80680$1b447182@cas.mcmaster.ca> (raw)
In-Reply-To: <16285.28219.572454.790216@beertje.william.bogus>

> If you really want more control over code generation (not forgetting
> that just writing out what you want by hand is often the simplest
> option in practice!) then I think C++ templates are a dead end---far
> better to make the object language the same as the target language,
> as in MetaOcaml and similar.

If you know what you want, MetaOcaml is great.  If you are
prototyping/experimenting, then a typeless symbolic language (like Scheme or
Maple) give you much greater flexibility.  MetaOcaml's contortions to get
something like:

> pow := proc(x,n::nonnegint) if n=0 then 1 else times(x,pow(x,n-1)) end if
end proc;
pow := proc(x, n::nonnegint)
    if n = 0 then 1 else times(x, pow(x, n - 1)) end if
end proc

> unapply(pow(x,5), x);
       x -> times(x, times(x, times(x, times(x, times(x, 1)))))

is really quite burdensome.  Having the freedom of dealing with 'open' terms
as first-class citizens is really very powerful, if somewhat dangerous.

I have found Thiemann's PGG as the 'front end', coupled with
Scheme-to-YourFavoriteLanguage translation to be quite effective PE
strategy, at least when more basic 'symbolic computation' is not enough.

Jacques

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-10-27 20:08 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-27  1:41 Ben Kavanagh
2003-10-27  7:14 ` Damien
2003-10-27 15:39   ` William Chesters
2003-10-27 18:50     ` Andrew Lenharth
2003-10-27 19:12       ` William Chesters
2003-10-27 20:08         ` Jacques Carette [this message]
2004-02-04  3:03           ` Walid Taha
2003-10-27 22:11         ` Andrew Lenharth
2004-02-04  2:59       ` Walid Taha
2004-02-04  5:53         ` Andrew Lenharth
2004-02-05 21:29           ` Walid Taha
2003-10-27 19:17     ` Yann Regis-Gianas
2003-10-28 10:46       ` William Chesters
2004-02-04  2:22         ` Walid Taha
2004-02-04  2:56     ` Walid Taha
2003-10-28 15:09   ` Dmitry Lomov
2003-10-27 15:16 ` Vincent Balat [prof Moggi team]
2004-02-04  2:51 ` Walid Taha
2004-02-04 10:26   ` Ben Kavanagh
2004-02-04 10:32   ` Ben Kavanagh
2004-02-05 21:11     ` Walid Taha

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='002d01c39cc6$1ac80680$1b447182@cas.mcmaster.ca' \
    --to=carette@mcmaster.ca \
    --cc=caml-list@inria.fr \
    /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).