From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by c5ff346549e7 (Postfix) with ESMTP id B48D45D5 for ; Wed, 7 Oct 2020 06:25:25 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.77,345,1596492000"; d="scan'208";a="471329784" Received: from prod-listesu18.inria.fr (HELO sympa.inria.fr) ([128.93.162.160]) by mail2-relais-roc.national.inria.fr with ESMTP; 07 Oct 2020 08:25:21 +0200 Received: by sympa.inria.fr (Postfix, from userid 20132) id 65A78E0B83; Wed, 7 Oct 2020 08:25:21 +0200 (CEST) Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id C326BE00E5 for ; Wed, 7 Oct 2020 08:25:14 +0200 (CEST) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=oleg@okmij.org; spf=Pass smtp.mailfrom=oleg@okmij.org; spf=None smtp.helo=postmaster@mail1.g3.pair.com IronPort-PHdr: =?us-ascii?q?9a23=3AT+Zelh2EhZyiqC7FsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?se0eL/ad9pjvdHbS+e9qxAeQG9mCtLQY1qGG7OjJYi8p2d65qncMcZhBBVcuqP?= =?us-ascii?q?49uEgeOvODElDxN/XwbiY3T4xoXV5h+GynYwAOQJ6tL1LdrWev4jEMBx7xKRR6?= =?us-ascii?q?JvjvGo7Vks+7y/2+94fcbglVhjexe7x/IRW5oQjStMQdnJdvJLs2xhbVuHVDZv?= =?us-ascii?q?5YxXlvJVKdnhb84tm/8Zt++ClOuPwv6tBNX7zic6s3UbJXAjImM3so5MLwrhnM?= =?us-ascii?q?URGP5noHXWoIlBdDHhXI4wv7Xpf1tSv6q/Z91SyHNsD4Ubw4RTKv5LptRRT1ii?= =?us-ascii?q?kIKiQ5/XnZhMJwkqxVvRGvqBNjzIHJbo6YL+Z+cr/HcN8GWWZMRNhdWipcCY28?= =?us-ascii?q?dYsPCO8BMP5BoYn5uVQOoga1CA6rBOPr1DBIiWT73ao50+QkEAHG3hYsH9UUsH?= =?us-ascii?q?Tbtdj4MroZXu+pwqfS1zrDc+9W1inn6IjOah0sov+CULxyfMfPxkQiCQ3Ig1GM?= =?us-ascii?q?pYD5MD2Y1OoDvmaU4udiVu+il24pph1+rzWx28sihZfFiIILxl7L8Sh3wIg7KN?= =?us-ascii?q?ulQ0B1Zt6kFYFftyCcN4ZuRcMiQGRouCc4yrEcvp67ZicKxZI6zBDcc/yKa4mF?= =?us-ascii?q?7xP5WOufJTp0nnxodKiiixqv/kWs0vPwWtSo3FpQsyZInNrBumoT2xDP6cWLUP?= =?us-ascii?q?pw80On1D2SzQ7c8PtELloxlafDK54u3Lowlp0LvETGBCD2mUH2gLKMekUr9OWk?= =?us-ascii?q?8fznba/npp+GLYN7lgb+MqE2lsy+B+Q3LBQOUnCa9Om9zrHu80n0TK9Eg/Esj6?= =?us-ascii?q?XVrZ/XKdwepqGjAg9V1ogj6wy4DzejyNkYmn0HI0xKeB+ciIjpOFTOIPH6Dful?= =?us-ascii?q?hFSsijhry+jcPrL9GpXNMmTDkLD5cLlh8UFczQ4zwclb55JVEbEBPOn+WlTxtd?= =?us-ascii?q?zdFh82KRa4w+fhCNVn14MRQ3iDAqGDMPCajVjd7esqJ6yIZZQJkDf7MfksofD0?= =?us-ascii?q?3lEjnlpIWq2k0tNDb3S1EdxhIECYYzzrmNhXQjRChRY3UOG/0A7KajVUfXvnB/?= =?us-ascii?q?thtAF+M5qvCML4fq7ogLGF237qTJhfZ2QfTF/XV2/hdp/CUPAJOnrLc51R1wcc?= =?us-ascii?q?XL3kcLcPkBSntQv00b1id7OG/S4dtJCl08J6tbSKyUMCsAdsBsHY6FmjCnlulz?= =?us-ascii?q?pRFTg12aF950tnxQXb3A=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0C0AADtXX1fh3IDJ0JggQmEaVYBMSyNP?= =?us-ascii?q?wikWAsBAwENIwoCBAEBhlMCHQcBBDQTAhABAQUBAQECAQMDBAETAQEBCgsJCCm?= =?us-ascii?q?FYwyCNyKDRxM6eoQCAYJ7AQ+oZIEBM4pegTiNMw4NgUBAgRGDToJFFwOCK4J9g?= =?us-ascii?q?i0EnE6aUy+CcoEdgSyGNpFYMYMRgSmBJIc3lBMBjjyPTJVRgWuBek0wCIMkCUc?= =?us-ascii?q?ZDY45iGuFUTIBMjcCBgoBAQMJWI1wAQE?= X-IPAS-Result: =?us-ascii?q?A0C0AADtXX1fh3IDJ0JggQmEaVYBMSyNPwikWAsBAwENIwo?= =?us-ascii?q?CBAEBhlMCHQcBBDQTAhABAQUBAQECAQMDBAETAQEBCgsJCCmFYwyCNyKDRxM6e?= =?us-ascii?q?oQCAYJ7AQ+oZIEBM4pegTiNMw4NgUBAgRGDToJFFwOCK4J9gi0EnE6aUy+CcoE?= =?us-ascii?q?dgSyGNpFYMYMRgSmBJIc3lBMBjjyPTJVRgWuBek0wCIMkCUcZDY45iGuFUTIBM?= =?us-ascii?q?jcCBgoBAQMJWI1wAQE?= X-IronPort-AV: E=Sophos;i="5.77,345,1596492000"; d="scan'208";a="471329737" X-MGA-submission: =?us-ascii?q?MDFMqXoOW7sMOslPNYA/4u0PzA01Iq2BcAXfxQ?= =?us-ascii?q?8z3iAc3HvBlAIrYaEwSt+fTBSGLbEef2IndjTitr+XD8aLbqjKnCxhIl?= =?us-ascii?q?HYkF/1yxoSDZ3cq43YoZwePjhA2zuc8J0mzDLYzh3EsMeT0JYaFgyR41?= =?us-ascii?q?Ft6x+KDlFqFvzxGDkCA23OKA=3D=3D?= Received: from mail1.g3.pair.com ([66.39.3.114]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Oct 2020 08:25:13 +0200 Received: from mail1.g3.pair.com (localhost [127.0.0.1]) by mail1.g3.pair.com (Postfix) with ESMTP id 0CF6E3FBA73; Wed, 7 Oct 2020 02:25:09 -0400 (EDT) Received: from Melchior.localnet (69.208.138.210.rev.vmobile.jp [210.138.208.69]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail1.g3.pair.com (Postfix) with ESMTPSA id 268D55835D6; Wed, 7 Oct 2020 02:25:07 -0400 (EDT) Date: Wed, 7 Oct 2020 15:29:24 +0900 From: Oleg To: caml-list@inria.fr Message-ID: <20201007062924.GA1995@Melchior.localnet> Mail-Followup-To: Oleg , caml-list@inria.fr MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) Subject: [Caml-list] ANN: BER MetaOCaml N111, for OCaml 4.11.1 Reply-To: Oleg X-Loop: caml-list@inria.fr X-Sequence: 18262 Errors-To: caml-list-owner@inria.fr Precedence: list Precedence: bulk Sender: caml-list-request@inria.fr X-no-archive: yes List-Id: List-Help: List-Subscribe: List-Unsubscribe: List-Post: List-Owner: List-Archive: Archived-At: BER MetaOCaml N111 is a strict superset of OCaml 4.11.1 for ``writing programs that generate programs''. BER MetaOCaml adds to OCaml the type of code values (denoting ``program code'', or future-stage computations), and two basic constructs to build them: quoting and splicing. The generated code can be printed, stored in a file -- or compiled and linked-back to the running program, thus implementing run-time code optimization. A well-typed BER MetaOCaml program generates only well-scoped and well-typed programs: The generated code shall compile without type errors. Staging-annotation--free BER MetaOCaml is identical to OCaml; BER MetaOCaml can link to any OCaml-compiled library (and vice versa); findlib and other tools can be used with BER MetaOCaml as they are, in their binary form. BER MetaOCaml N111 is a superset of the recently released OCaml 4.11.1. The significant addition is let rec insertion: the facility to generate groups of mutually recursive definitions whose size is not statically known. It is now possible to control the scope of let-insertion, which is often necessary when the let-bound expression is effectful. The well-scopedness guarantee is still maintained. Offshoring got more polish. As the simplest illustration of let rec insertion, the specialization of the Ackermann function let rec ack m n = if m = 0 then n+1 else if n = 0 then ack (m-1) 1 else ack (m-1) (ack m (n-1)) to m=2 produces the following code val sac2 : (int -> int) code = .< let rec h_6 n_7 = n_7 + 1 and h_4 n_5 = if n_5 = 0 then h_6 1 else h_6 (h_4 (n_5 - 1)) and h_2 n_3 = if n_3 = 0 then h_4 1 else h_4 (h_2 (n_3 - 1)) in h_2>. For more explanations, please see http://okmij.org/ftp/ML/MetaOCaml.html which now has dedicated sections on let rec insertions and offshoring. See also ChangeLog and NOTES.txt in the BER MetaOCaml distribution. BER MetaOCaml N111 should be available though OPAM, hopefully soon. In the meanwhile, it is available as a set of patches to the OCaml 4.11.1 distribution. http://okmij.org/ftp/ML/ber-metaocaml.tar.gz See the INSTALL document in that archive. You need the source distribution of OCaml 4.11.1.