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 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id D5BA8BB84 for ; Mon, 6 Oct 2008 18:47:25 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqUDAB/e6UjAXQIniGdsb2JhbACTYQEBARUiom+FAjyBag X-IronPort-AV: E=Sophos;i="4.33,368,1220220000"; d="scan'208";a="17716412" Received: from concorde.inria.fr ([192.93.2.39]) by mail3-smtp-sop.national.inria.fr with ESMTP; 06 Oct 2008 18:47:25 +0200 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m96GlMlO006860 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Mon, 6 Oct 2008 18:47:25 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvABAKLd6UhQW+UCgWdsb2JhbACTYQEBFiIEomqFAjyBag X-IronPort-AV: E=Sophos;i="4.33,368,1220220000"; d="scan'208";a="29957615" Received: from main.gmane.org (HELO ciao.gmane.org) ([80.91.229.2]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/AES256-SHA; 06 Oct 2008 18:47:24 +0200 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1KmtEw-0008Ij-4M for caml-list@inria.fr; Mon, 06 Oct 2008 16:47:22 +0000 Received: from daimi-pat.daimi.au.dk ([130.225.0.251]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2008 16:47:22 +0000 Received: from ccshan by daimi-pat.daimi.au.dk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Mon, 06 Oct 2008 16:47:22 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: caml-list@inria.fr From: Chung-chieh Shan Subject: Re: Metaprogramming features Date: Mon, 6 Oct 2008 18:46:49 +0200 Message-ID: References: <884069.59268.qm@web54601.mail.re2.yahoo.com> <200810040300.02624.jon@ffconsultancy.com> <48EA1B54.5030200@janestcapital.com> <200810061656.42903.jon@ffconsultancy.com> X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: daimi-pat.daimi.au.dk User-Agent: tin/1.9.3-20080506 ("Dalintober") (UNIX) (Linux/2.6.26 (i686)) Sender: news X-Miltered: at concorde with ID 48EA411A.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; gmane:01 non-trivial:01 trivial:01 metaocaml:01 ocaml:01 higher-order:01 trivial:01 metaocaml:01 ocaml:01 pepm:01 subset:01 polymorphism:01 pepm:01 sig:01 2.5:98 Jon Harrop 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