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 mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by sympa.inria.fr (Postfix) with ESMTPS id 8312E7FA5F for ; Mon, 16 Jan 2017 14:19:32 +0100 (CET) Authentication-Results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=examachine@gmail.com; spf=Pass smtp.mailfrom=examachine@gmail.com; spf=None smtp.helo=postmaster@mail-vk0-f44.google.com Received-SPF: None (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of examachine@gmail.com) identity=pra; client-ip=209.85.213.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="examachine@gmail.com"; x-conformance=sidf_compatible Received-SPF: Pass (mail3-smtp-sop.national.inria.fr: domain of examachine@gmail.com designates 209.85.213.44 as permitted sender) identity=mailfrom; client-ip=209.85.213.44; receiver=mail3-smtp-sop.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 (mail3-smtp-sop.national.inria.fr: no sender authenticity information available from domain of postmaster@mail-vk0-f44.google.com) identity=helo; client-ip=209.85.213.44; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="postmaster@mail-vk0-f44.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3APKRrgRUaPd8pIY8wExv908a9ygPV8LGtZVwlr6E/?= =?us-ascii?q?grcLSJyIuqrYbBOFt8tkgFKBZ4jH8fUM07OQ6PG8Hzddqs/e6zgrS99lb1c9k8?= =?us-ascii?q?IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUhrwOhBo?= =?us-ascii?q?KevrB4Xck9q41/yo+53Ufg5EmCexbal8IRiyogjdrMcbjIttJqosyBbErGZDdv?=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buKYbYWsj5i7WE2GK/H4ZKTmFAEFGFV3nyIdaqQfAJPQ+IK94ptS4H?= =?us-ascii?q?SKKoT8d12AGnsQbxy7thI8Lb/yQZsdTo090jtL6brg076TEhV5fV6GqKVWwh2z?= =?us-ascii?q?5RSg=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0DICQDkx3xYhizVVdFdHAEBBAEBCgEBF?= =?us-ascii?q?wEBBAEBCgEBgw4BAQEBAUABMwqBCQeDSoEEmWsIAQEGgRkEgjaGPocNhzYqhXg?= =?us-ascii?q?CghoHQhUBAQEBAQEBAQEBARIBAQEICwsKHTCCMxuCHAEEASMdARsSBgYDDAYDA?= =?us-ascii?q?gsaHQICIgERAQUBChIGExKIVQEDCwUIDpB7kQw/jAOCAwUBHIMJBYNRChknAwp?= =?us-ascii?q?VgXcBAQgCAR0CBhKFb4UrgmuCCoJZgl4FhyQMiG2LHYZdiwKBd1GEPYlokSYUH?= =?us-ascii?q?oEUDyaBNxIdTxSDaykggW07NYhuAQEB?= X-IPAS-Result: =?us-ascii?q?A0DICQDkx3xYhizVVdFdHAEBBAEBCgEBFwEBBAEBCgEBgw4?= =?us-ascii?q?BAQEBAUABMwqBCQeDSoEEmWsIAQEGgRkEgjaGPocNhzYqhXgCghoHQhUBAQEBA?= =?us-ascii?q?QEBAQEBARIBAQEICwsKHTCCMxuCHAEEASMdARsSBgYDDAYDAgsaHQICIgERAQU?= =?us-ascii?q?BChIGExKIVQEDCwUIDpB7kQw/jAOCAwUBHIMJBYNRChknAwpVgXcBAQgCAR0CB?= =?us-ascii?q?hKFb4UrgmuCCoJZgl4FhyQMiG2LHYZdiwKBd1GEPYlokSYUHoEUDyaBNxIdTxS?= =?us-ascii?q?DaykggW07NYhuAQEB?= X-IronPort-AV: E=Sophos;i="5.33,239,1477954800"; d="scan'208,217";a="209309409" Received: from mail-vk0-f44.google.com ([209.85.213.44]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 16 Jan 2017 14:18:32 +0100 Received: by mail-vk0-f44.google.com with SMTP id k127so27209497vke.0 for ; Mon, 16 Jan 2017 05:18:32 -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=AOTjLk05T1vU94SVGirc2HXLleYHcJyz3dqcDWrfL58=; b=bdtIO5CKVt/DHItVduy2am3VsxbIMT4F0OidWVwhnI+sTjfpF/CJf5v3LhP0tnm1Zx d/HZqon/t32YyXWzUZDQEArJ8nJpjeQ/LaMkj1ncWqR6sD0XVsYzTH9VLc1r8/7S3q1+ GiWyO1nOOIm+zeAuzsan0FRO8loujGmCDcEtfRIfPUHlfL7nSgeLrs+KVp29jhafGZto Uah26I0kY0Pc8VVkP1TxuTG7t1EvwQIAI/obiACCxqkXStvmHnIoc6KFkVtk+xZrKGwd R6IuQXOIgJSbYz0uSF/5R0Pg9CumdGTGJu9qGni14h1/ZTNMXCpQJOET+LzQat5unGIy Yrow== 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=AOTjLk05T1vU94SVGirc2HXLleYHcJyz3dqcDWrfL58=; b=BsTGW73U6zffJSwLScZdu1cNdqrXsCxUOAsrvgEjwS+G9/O0dySS6FI6wHhoT945CN /mnEwnzX1iaD8W9G7vN8p+DDGmmUR6299cjHFtMsbxDg+2STlE26aKWabxn4GRqb8vzq 8A1PlJVm+Azo3YmpesHA9zqKDhderkgmPGaNwImDWLkTyanh9OLnonDPT6KhGasdktDb 2IK5q+X3VDK0L1Db2UsaJqIRVBrNifJEOMer8DaYp5ktMFUs6Ql3rzWudRg2+o35bkM2 11RCWcY9ljCt51oA+6260I6FRPjYKGE8Oas/fe7dEvg/SEkmhX5XaoDXSkiCeoAJrysX SRKw== X-Gm-Message-State: AIkVDXITNRubcLw34cHDcYWckbB2noIbZk6rKTQsTDK/Ey7X4ET6IK7jDdQp8J+F4uU7uJY/Po94ZKdaxqHF1w== X-Received: by 10.31.32.77 with SMTP id g74mr13889871vkg.122.1484572711008; Mon, 16 Jan 2017 05:18:31 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.91.214 with HTTP; Mon, 16 Jan 2017 05:18:30 -0800 (PST) In-Reply-To: <20170101152022.GA1291@Magus.localnet> References: <20170101152022.GA1291@Magus.localnet> From: Eray Ozkural Date: Mon, 16 Jan 2017 16:18:30 +0300 Message-ID: To: Caml List Content-Type: multipart/alternative; boundary=001a11469b24154068054636050c Subject: Re: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0 --001a11469b24154068054636050c Content-Type: text/plain; charset=UTF-8 Hi Oleg, I have a question. Have you ever designed at length how to implement a super fast *interpreted* version of metaocaml, or let me put it this way: do you think if that is possible at all? 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 --001a11469b24154068054636050c Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi Oleg,

I have a question. Have you ev= er designed at length how to implement a super fast *interpreted* version o= f metaocaml, or let me put it this way: do you think if that is possible at= all?

Best,

Eray

On Sun, 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
--001a11469b24154068054636050c--