From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@sympa.inria.fr Delivered-To: caml-list@sympa.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by sympa.inria.fr (Postfix) with ESMTPS id 14B467ED7A for ; Thu, 20 Sep 2012 11:36:47 +0200 (CEST) Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.115; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail1-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.115 as permitted sender) identity=mailfrom; client-ip=66.39.3.115; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible; x-record-type="v=spf1" Received-SPF: None (mail1-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@www1.g3.pair.com) identity=helo; client-ip=66.39.3.115; receiver=mail1-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@www1.g3.pair.com"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AkACAO3iWlBCJwNzd2dsb2JhbABFq1qRXQEMBw8HO4IgAQEEHlwzHH2IAgYLujOOPoMfA5VjAYEUkXM X-IronPort-AV: E=Sophos;i="4.80,453,1344204000"; d="scan'208";a="173941605" Received: from www1.g3.pair.com ([66.39.3.115]) by mail1-smtp-roc.national.inria.fr with SMTP; 20 Sep 2012 11:36:45 +0200 Received: (qmail 26808 invoked by uid 9370); 20 Sep 2012 09:36:43 -0000 Date: 20 Sep 2012 09:36:43 -0000 Message-ID: <20120920093643.26807.qmail@www1.g3.pair.com> From: oleg@okmij.org To: bobzhang1988@gmail.com CC: caml-list@inria.fr X-Validation-by: oleg@okmij.org Subject: [Caml-list] Call for collaboration on the future of camlp4 Hongbo Zhang wrote: > Meta-ocaml is orthogonal to camlp4 as well, but I did not see any hope > that it will be pushed into ocaml compiler, > since the main purpose of meta-ocaml is to do some run-time > optimization, without a native jit compiler support, It does > not make sense. I believe you might be short-changing MetaOCaml. First of all, why MetaOCaml needs JIT? It is already possible in MetaOCaml to generate code at run-time, to compile it and link-in. The new code is generated by the OCaml compiler itself, and works as if it were part of the original code. Such run-time optimization can indeed be useful (e.g., profile-based optimization). I don't see why we need JIT if we already have the original compiler itself. However viewing MetaOCaml as a run-time optimizer misses a lot. MetaOCaml is a code generator with certain assurances of correctness -- it generates code that one would not write by hand. The recent example of generating code for stencil computations in high-performance computing http://okmij.org/ftp/meta-programming/HPC.html#stencil was quite illustrative: MetaOCaml has generated code for edge cases that human really did not want to write (and did not actually write). Edge cases are really tedious and really difficult to get right; automation is of great help. The generated code can be printed-out and used in a project as any other code. MetaOCaml can be used to generate libraries of specialized high-performance code. > Personally, I prefer common lisp's macros to scheme. It's painful > to play with racket's macros as well Well, it is painful for some people to use typed languages too. Untyped languages offer so much freedom, some think. What is often forgotten is that the benefit of the type system is not in what code you can write, but what code you cannot. Likewise, a syntax extension should be evaluated not only on what it allows but also on what it prevents. As I general remark: it is not clear why so much fixation on camlp4. Other people have tried extensible syntaxes. For example: - Felix - Notation of Coq - Stratego http://strategoxt.org/ In particular, see http://strategoxt.org/Sdf/SdfLanguage Stratego could do program transformations in concrete syntax. Maybe that would be a better approach? Maybe Stratego would satisfy all our needs?