From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by yquem.inria.fr (Postfix) with ESMTP id B5D74BC57 for ; Tue, 2 Mar 2010 11:33:08 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AiIZAC14jEvNm0EP/2dsb2JhbACPT3eHN4MBc74hhHsEgxeLHw X-IronPort-AV: E=Sophos;i="4.49,566,1262559600"; d="scan'208";a="45751048" Received: from virginia.nps.edu ([205.155.65.15]) by mail2-smtp-roc.national.inria.fr with ESMTP; 02 Mar 2010 11:33:07 +0100 Received: from Adric.ern.nps.edu ([172.20.216.170]) by virginia.nps.edu with Microsoft SMTPSVC(6.0.3790.3959); Tue, 2 Mar 2010 02:33:05 -0800 Received: by Adric.ern.nps.edu (Postfix, from userid 760) id 4436317468; Tue, 2 Mar 2010 02:30:31 -0800 (PST) From: oleg@okmij.org To: caml-list@inria.fr, metaocaml-hackers-l@mailman.rice.edu Subject: MetaOCaml lives! Message-Id: <20100302103031.4436317468@Adric.ern.nps.edu> Date: Tue, 2 Mar 2010 02:30:31 -0800 (PST) X-OriginalArrivalTime: 02 Mar 2010 10:33:05.0202 (UTC) FILETIME=[BE28D920:01CAB9F3] X-Spam: no; 0.00; oleg:01 metaocaml:01 metaocaml:01 ocaml:01 multi-stage:01 implements:01 ocaml:01 byte-code:01 taha:01 cristiano:01 staging:01 patched:01 byte-code:01 compilation:01 cross-stage:01 This is to announce BER MetaOCaml, a streamlined version of MetaOCaml. BER MetaOCaml is a conservative extension of OCaml with the primitive type of code values, and three basic multi-stage expression forms: Brackets, Escape, and Run. BER MetaOCaml implements the type system based on environment classifiers to type-check expressions that produce and run code values. BER MetaOCaml makes no other changes to the OCaml language, remaining fully compatible with the underlying OCaml system. BER MetaOCaml is current with the byte-code OCaml release 3.11.2. BER MetaOCaml is based on an earlier version of MetaOCaml developed by Walid Taha, Cristiano Calcagno, and Edward Pizzi, with the help and advice of Xavier Leroy. The goal of the BER MetaOCaml project is to reduce as much as possible the differences between MetaOCaml and the mainline OCaml, to make it easier to keep MetaOCaml up-to-date and ensure its long-term viability. We aim to find the most harmonious way of integrating staging with OCaml, with the remote hope that some of the changes would make it to the main OCaml branch. Therefore BER MetaOCaml is distributed as a set of patches to OCaml plus a separate library ber-metaocaml. The patched OCaml is responsible for producing and type-checking code values. Processing code values -- printing, executing, compiling to byte-code, to native code, to C, etc. are to be done in the `user-level,' library code. Programmers may write new ways of processing code values -- for example, to compile them to LLVM or JavaScript -- without modifying OCaml or BER MetaOCaml. This message announces the first stable version of byte-code BER MetaOCaml. Light testing confirms that BER MetaOCaml is backwards-compatible with MetaOCaml, handling previously written MetaOCaml code exactly as it was. Currently BER MetaOCaml is restricted to byte-code. Support for the native code compilation is of high priority. However, better ways of handling cross-stage persistent values have to be investigated first. Camlp4 is not yet extended to support MetaOCaml's special forms, bracket and escape. Offshoring is temporarily disabled; it is meant to be separated into a dedicated `user-level' library. The BER MetaOCaml distribution can be downloaded from http://okmij.org/ftp/ML/ber-metaocaml.tar.gz To install BER MetaOCaml, one needs a configured version of OCaml 3.11.2. The installation involves patching the OCaml distribution, bootstrapping the system, and compiling the ber-metaocaml library and the BER MetaOCaml toplevel. The patched OCaml compiler is fully source-compatible with OCaml and can process OCaml code, with staging constructs or without. The patched OCaml compiler can compile into native code (although such sources may not contain any staging constructs at the moment). Please see the INSTALL and README files in the BER MetaOCaml distribution for more details. The number of patched OCaml files may appear high. First of all, BER MetaOCaml modifies 23 fewer files compared to the original MetaOCaml. There are plans and hunches to reduce the number of the patched files further. Many of the modifications are quite trivial. For example, since BER MetaOCaml extends the AST data type with staging constructs, any code that processes AST has to be modified (at least, to ignore the extra AST variants). One would imagine that quite a lot of code in a compiler deals with AST. I am indeed interested in problem reports, questions and suggestions. Please follow-up to metaocaml-hackers-l@mailman.rice.edu, or mail me privately. I am very grateful to Walid Taha, Jacques Carette, and Chung-chieh Shan for many helpful discussions, suggestions and advice.