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 mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 9A8DF7FD90 for ; Sat, 14 Jan 2017 13:10:49 +0100 (CET) Authentication-Results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=examachine@gmail.com; spf=Pass smtp.mailfrom=examachine@gmail.com; spf=None smtp.helo=postmaster@mail-ua0-f172.google.com Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of examachine@gmail.com) identity=pra; client-ip=209.85.217.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="examachine@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail2-smtp-roc.national.inria.fr: domain of examachine@gmail.com designates 209.85.217.172 as permitted sender) identity=mailfrom; client-ip=209.85.217.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="examachine@gmail.com"; 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@mail-ua0-f172.google.com) identity=helo; client-ip=209.85.217.172; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="postmaster@mail-ua0-f172.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3ANx7z5B0z5GVzndTqsmDT+DRfVm0co7zxezQtwd8Z?= =?us-ascii?q?segSI/ad9pjvdHbS+e9qxAeQG96Kt7Qf0KGP7f+oGTRZp83e4DZaKN0EfiRGoP?= =?us-ascii?q?tVtjRoONSCB0z/IayiRA0BN+MGamVY+WqmO1NeAsf0ag6aiHSz6TkPBke3blIt?= =?us-ascii?q?dazdU7TfhMWv1u2054abI0AR3GL8MoVJMQ6uoA7Nms4TiIpkYuZtm1qa6kdPLs?= =?us-ascii?q?NSyGwgcVWXkhnU4cS1/Zwl9D5f7bZp3MdFVe3efr8kBehTBTEidmQ0/9HDtB/Z?= =?us-ascii?q?TALJ6GFKAUsMlR8dLhLM/VndTJTsqCL+/r5wyCCfNMb2TLY5cTun5qZvDhTvjX?= =?us-ascii?q?FUZHYC7GjLh5ko3+pgqxW7qkk6ntfZ?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0CUBABNFHpYhqzZVdFeHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgw4BAQEBAUA+gQkHg0qBBJlzAQEGgR2CNoY+jkMqhXgCghEHQhU?= =?us-ascii?q?BAQEBAQEBAQEBARIBAQEICwsKHTCCMwQBFgWCFwEEASMdARsSBgYDDAYDAgsaH?= =?us-ascii?q?QICIgERAQUBChIGARISiFUBAwsFCA6TFJEMP4wDggMFARyDCQWDYAoZJwMKVYF?= =?us-ascii?q?3AQoBAQEBGwIGEoVvhCWBBoJrggqCWYJeBYckDIhtix2GXYsCgXdRhD2JaJEmF?= =?us-ascii?q?B6BFA8mgTcSHU8Ug2spIIFtOzWHS4FPAQEB?= X-IPAS-Result: =?us-ascii?q?A0CUBABNFHpYhqzZVdFeHAEBBAEBCgEBFwEBBAEBCgEBgw4?= =?us-ascii?q?BAQEBAUA+gQkHg0qBBJlzAQEGgR2CNoY+jkMqhXgCghEHQhUBAQEBAQEBAQEBA?= =?us-ascii?q?RIBAQEICwsKHTCCMwQBFgWCFwEEASMdARsSBgYDDAYDAgsaHQICIgERAQUBChI?= =?us-ascii?q?GARISiFUBAwsFCA6TFJEMP4wDggMFARyDCQWDYAoZJwMKVYF3AQoBAQEBGwIGE?= =?us-ascii?q?oVvhCWBBoJrggqCWYJeBYckDIhtix2GXYsCgXdRhD2JaJEmFB6BFA8mgTcSHU8?= =?us-ascii?q?Ug2spIIFtOzWHS4FPAQEB?= X-IronPort-AV: E=Sophos;i="5.33,227,1477954800"; d="scan'208,217";a="255310461" Received: from mail-ua0-f172.google.com ([209.85.217.172]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 14 Jan 2017 13:10:48 +0100 Received: by mail-ua0-f172.google.com with SMTP id y9so54337352uae.2 for ; Sat, 14 Jan 2017 04:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=cBKRiHjzylAidc6uyjc6jKPoo/q1INXi5lJSS9BY/rw=; b=h4546jG0PnbiSrRm5fTzX/V7AEb19Yr1/qxyo0zVEZhF0AB2kr5zltoo6T8KEZYHpl RtXtsD6yCOMCDiLbrnJ+fzamkOuPJztkLYPRhMlr5MFheA3XQ8iunSxShp1a/raHqqIV oxwgyME8kxcXQeDDRFjgYQJPccIdt4LsBxanRk/zeqZYRYG5tVXyePbKB5PRLDQAxnqk 2NIeEunwtyh2GHxxF6s86onZ1iG5DAnF5lNDAcUB4WrQFwDhiIa2R/51P2ixtdlUKN54 uwjBBkPFXY+cktRtsuX7s7PGBfq4InuHTZGitBEt+7TGVew0c6F7Zp3NIt0rpDId8Mqk CAqQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=cBKRiHjzylAidc6uyjc6jKPoo/q1INXi5lJSS9BY/rw=; b=XQOKYvFWtUPb3ouuH6Q4ef0m8JCkmGKdodeHJEf9opjw0EyC5y7cw7OP0oJmxMi3sk +5XA2NTVOSDeUSFqz9NnJSvSUZGDRD4/UICTmS9DrirzguU/wX9e8+mGi7BO9MILII78 ji7gS0qezvZyFu6PfS/8dDNrylsYh6/4qz0wJ79L5X/UjBwP4EGcj71kyOyzgRQSAl6y 15/Zzg3H/oz1SISHgQ4y6xlsAs8I+DETCwtOlkIDqJIRY/VmCnu864tiMJLHTaXtjpi7 7HRES2UHfjM0hMSddLELu3cJ84SktcsbUjwucwaEtjExNAdOPn3x/jsSSgwRA+IajZZa DnSQ== X-Gm-Message-State: AIkVDXJUqu4IEWN9DS9ZzqorVmuvvciyGPQ+SdFVTV6HAuz5blzpdmArRDPDjpledM80rA4IL4wslJr7X/vEBw== X-Received: by 10.159.37.202 with SMTP id 68mr13030400uaf.80.1484395847186; Sat, 14 Jan 2017 04:10:47 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.91.214 with HTTP; Sat, 14 Jan 2017 04:10:46 -0800 (PST) In-Reply-To: <20170101152022.GA1291@Magus.localnet> References: <20170101152022.GA1291@Magus.localnet> From: Eray Ozkural Date: Sat, 14 Jan 2017 15:10:46 +0300 Message-ID: To: Oleg , Caml List Content-Type: multipart/alternative; boundary=001a1137a4322d821c05460cd7b0 Subject: Re: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0 --001a1137a4322d821c05460cd7b0 Content-Type: text/plain; charset=UTF-8 This sounds far better than a minor improvement, for many macro-like apps this would be a major roadblock as there is a big performance gap in interpreted and compiled code in ocaml. Could be a game changer. Congratulations Oleg! Best, Eray On Sun, Jan 1, 2017 at 6:20 PM, Oleg wrote: > > 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. > > > -- > Caml-list mailing list. Subscription management and archives: > https://sympa.inria.fr/sympa/arc/caml-list > Beginner's list: http://groups.yahoo.com/group/ocaml_beginners > Bug reports: http://caml.inria.fr/bin/caml-bugs > -- Eray Ozkural, PhD. Computer Scientist Founder, Gok Us Sibernetik Ar&Ge Ltd. http://groups.yahoo.com/group/ai-philosophy --001a1137a4322d821c05460cd7b0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
This sounds far better than a minor improvement, for many = macro-like apps this would be a major roadblock as there is a big performan= ce gap in interpreted and compiled code in ocaml. Could be a game changer. = Congratulations Oleg!

Best,

Era= y

On S= un, Jan 1, 2017 at 6:20 PM, Oleg <oleg@okmij.org> wrote:

BER MetaOCaml N104 is a strict superset of OCaml 4.04.0 for ``writing
programs that generate programs''.=C2=A0 BER MetaOCaml adds to OCam= l 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.=C2=A0 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=C2=A0 |let freshname =3D exp in ...= |
somewhere in the generated code and returns |.<freshname>.| (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.
=C2=A0 =C2=A0 =C2=A0 =C2=A0 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
=C2=A0 =C2=A0 =C2=A0 =C2=A0 http://okmij.org/ftp/ML/MetaO= Caml.html
as well as ChangeLog and NOTES.txt in the BER MetaOCaml distribution.


--
Caml-list mailing list.=C2=A0 Subscription management and archives:
https://sympa.inria.fr/sympa/arc/caml-list
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs



--
Eray Oz= kural, PhD. Computer Scientist
Founder, Gok Us Sibernetik Ar&Ge Ltd.=
http://groups.yahoo.com/group/ai-philosophy
--001a1137a4322d821c05460cd7b0--