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 sympa.inria.fr (Postfix) with ESMTPS id AC39A800B6 for ; Sun, 1 Jan 2017 16:20:41 +0100 (CET) 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 Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of oleg@okmij.org) identity=pra; client-ip=66.39.3.114; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="oleg@okmij.org"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of oleg@okmij.org designates 66.39.3.114 as permitted sender) identity=mailfrom; client-ip=66.39.3.114; receiver=mail2-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 (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@mail1.g3.pair.com) identity=helo; client-ip=66.39.3.114; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="oleg@okmij.org"; x-sender="postmaster@mail1.g3.pair.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3A33czhBDhkuNyMc74VCUUUyQJP3N1i/DPJgcQr6Af?= =?us-ascii?q?oPdwSP3+r8bcNUDSrc9gkEXOFd2CrakV16yO4uuxBiRAuc/H6y9SNsQUFlcsso?= =?us-ascii?q?Y/oU8JOIa9E0r1LfrnPWQRPf9pcxtbxUy9KlVfA83kZlff8TWY5D8WHQjjZ0Iu?= =?us-ascii?q?frymUt2as8Pi3Om3/9jXYh5UrDu7e7J7ahus/ivLscxDpo9vJe5lzR/ErVNPeO?= =?us-ascii?q?FXxyVvP13FzEW03du54JM2q3cYgPkm7cMVCag=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BBAADwHWlYh3IDJ0JdHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgwwBAQEBAX6BDI5JqnQqh1lCEQEBAQEBAQEBAQEBEgEBAQoLCQk?= =?us-ascii?q?dMEISgV8Ygl46QTQFiUsBDp8bkiWKaIZEh0uCKYIAC1qCMAWQAYp8gk2EB4pdD?= =?us-ascii?q?YF1UYEBgzaJVgKSPTWBTIQigXhjhCmEZgEBAQ?= X-IPAS-Result: =?us-ascii?q?A0BBAADwHWlYh3IDJ0JdHAEBBAEBCgEBFwEBBAEBCgEBgww?= =?us-ascii?q?BAQEBAX6BDI5JqnQqh1lCEQEBAQEBAQEBAQEBEgEBAQoLCQkdMEISgV8Ygl46Q?= =?us-ascii?q?TQFiUsBDp8bkiWKaIZEh0uCKYIAC1qCMAWQAYp8gk2EB4pdDYF1UYEBgzaJVgK?= =?us-ascii?q?SPTWBTIQigXhjhCmEZgEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,432,1477954800"; d="scan'208";a="252443107" 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; 01 Jan 2017 16:20:28 +0100 Received: from Magus.localnet (31.73.239.49.rev.vmobile.jp [49.239.73.31]) (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 5FEFF3FB4A1; Sun, 1 Jan 2017 10:20:25 -0500 (EST) Date: Mon, 2 Jan 2017 00:20:22 +0900 From: Oleg To: caml-list@inria.fr Message-ID: <20170101152022.GA1291@Magus.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.6.1 (2016-04-27) Subject: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0 BER MetaOCaml N104 is a strict superset of OCaml 4.04.0 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 N104 comes with one minor and two notable improvements. The minor improvement is the availability of the native MetaOCaml. If the generator is compiled in native mode (using metaocamlopt), the dynamically generated and run code will be natively-compiled as well. The lack of native mode was the most frequently heard criticism of MetaOCaml, although in my experience it hardly even matters. Off-line code specialization seems to be far more prevalent and useful than online one. Anyway, here we have it. The notable new features -- not seen in MetaOCaml (or MetaML, for that matter) -- are generating pattern-matching expression with the statically unknown number of clauses, and let-insertion as a primitive. To wit, |genlet exp| inserts |let freshname = exp in ...| somewhere in the generated code and returns |..| (unless |exp| is already syntactically a value such as a variable reference). The let-statement is inserted at the most appropriate place. BER MetaOCaml N104 should be available though OPAM, hopefully soon. In the meanwhile, it is available as a set of patches to the OCaml 4.04.0 distribution. http://okmij.org/ftp/ML/ber-metaocaml-104.tar.gz See the INSTALL document in that archive. You need the source distribution of OCaml 4.04.0, see the following URL for details. For more explanations, please see http://okmij.org/ftp/ML/MetaOCaml.html as well as ChangeLog and NOTES.txt in the BER MetaOCaml distribution.