Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Chung-chieh Shan <ccshan@post.harvard.edu>
To: caml-list@inria.fr
Subject: Re: Metaprogramming features
Date: Mon, 6 Oct 2008 18:46:49 +0200	[thread overview]
Message-ID: <p0spr5-n6i.ln1@mantle.rutgers.edu> (raw)
In-Reply-To: <200810061656.42903.jon@ffconsultancy.com>

Jon Harrop <jonathandeanharrop@googlemail.com> wrote in article <200810061656.42903.jon@ffconsultancy.com> in gmane.comp.lang.caml.inria:
> On Monday 06 October 2008 15:06:12 you wrote:
> > I'm definitely missing something here.  How are the above examples
> > different from:
> > let f () = 1 + 2;;
> > f ();;
> > let f x = 1 + x;;
> >
> > ?
> >
> > This is a non-trivial question, as there is no clear delineation between
> > data structures and executable code.

Indeed the question is not trivial.  Because MetaOCaml (like OCaml) has
higher-order functions (which may operate on code values or on functions
on code values), it is not trivial at all to `simulate' MetaOCaml in
OCaml.  Our PEPM paper this year (Kameyama, Kiselyov, and Shan) needed
the full power of System F just to express a subset of MetaOCaml without
polymorphism (even let-bound) or nested quotation (such as .<.<42>.>.).

    http://www.cs.rutgers.edu/~ccshan/metafx/pepm66-kameyama.pdf

Section 2 of this paper gives a series of examples to illustrate the
non-triviality of the simulation.  You can try to skip to Section 2.5
to see the most challenging example there.

> Exactly. The difference is (only) the performance characteristics.

To the contrary, that is not the only difference; the timing of
side effects (including non-termination and exceptions) can also be
different.  We give an example at the beginning of our Section 2.

-- 
Edit this signature at http://www.digitas.harvard.edu/cgi-bin/ken/sig
2008-10-01 International Day of Older Persons http://www.who.int/ageing/
2008-11-20 Universal Children's Day http://www.unicef.org/
2008-11-25 Day for the Elimination of Violence Against Women http://unifem.org/
1948-12-10 Universal Declaration of Human Rights http://everyhumanhasrights.org


  reply	other threads:[~2008-10-06 16:47 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-03 14:34 Jacques Carette
2008-10-03 15:09 ` [Caml-list] " Dario Teixeira
2008-10-04  2:00   ` Jon Harrop
2008-10-04  9:03     ` David Teller
2008-10-04 14:22       ` Jon Harrop
2008-10-06 14:06     ` Brian Hurt
2008-10-06 15:56       ` Jon Harrop
2008-10-06 16:46         ` Chung-chieh Shan [this message]
2008-10-07  0:17           ` [Caml-list] " Jon Harrop
2008-10-07 12:49             ` Nicolas Pouillard
2008-10-07 15:36               ` Jon Harrop
2008-10-07 16:31                 ` Jacques Carette
2008-10-03 16:01 ` [Caml-list] " David Teller
2008-10-03 21:14   ` Paolo Donadeo
2008-10-04  2:17   ` Jon Harrop
2008-10-04  9:10     ` David Teller
2008-10-04  0:49 ` Stefano Zacchiroli
2008-10-04  2:03   ` Jon Harrop
2008-10-04  8:23     ` Richard Jones
2008-10-04 14:31       ` Jon Harrop
2008-10-04 13:57         ` Richard Jones
2008-10-04 19:41           ` Jon Harrop
2008-10-04 19:04             ` Richard Jones
2008-10-05  1:05               ` Jon Harrop
2008-10-06 16:54               ` Chung-chieh Shan

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=p0spr5-n6i.ln1@mantle.rutgers.edu \
    --to=ccshan@post.harvard.edu \
    --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