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 632A17FA5F for ; Fri, 20 Jan 2017 04:13:03 +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-ua0-f193.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.217.193; 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.217.193 as permitted sender) identity=mailfrom; client-ip=209.85.217.193; 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-ua0-f193.google.com) identity=helo; client-ip=209.85.217.193; receiver=mail3-smtp-sop.national.inria.fr; envelope-from="examachine@gmail.com"; x-sender="postmaster@mail-ua0-f193.google.com"; x-conformance=sidf_compatible IronPort-PHdr: =?us-ascii?q?9a23=3AwosBxhdrIOMZEStJ6TdHNFhIlGMj4u6mDksu8pMi?= =?us-ascii?q?zoh2WeGdxcW7bR7h7PlgxGXEQZ/co6odzbGH7+a8Aydeu96oizMrSNR0TRgLiM?= =?us-ascii?q?EbzUQLIfWuLgnFFsPsdDEwB89YVVVorDmROElRH9viNRWJ+iXhpTEdFQ/iOgVr?= =?us-ascii?q?O+/7BpDdj9it1+C15pbffxhEiCCzbL52Ixi6twrcutcZjYZjNKo61wfErGZPd+?=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kfSmziSmBJRSLjRLGlmJGHzodoOJc/gJYSOWZMRml2pA?= =?us-ascii?q?HZOoTotp8RC1qEeuwLNiKq/Q+zYEnZPlztl8oePJw0Ic7ztxWumH2nDFaHN3g3?= =?us-ascii?q?kBQ3di0bB2pEV2ylaF3IB3hvVZEZpY4PYfAVRyDoLV0+EvU4O6YQnGZNrcDQv/?= =?us-ascii?q?Tw=3D=3D?= X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: =?us-ascii?q?A0BDCQBlf4FYf8HZVdFeHAEFAQsBg0ABA?= =?us-ascii?q?QEBAUE0CoEJB4NMmmkGgR2CNoY+jkQshXYCgXoHQxABAQEBAQEBAQEBARIBAQk?= =?us-ascii?q?LCwobMoIzG4IcAQQBIx0BGxgGAwELBgULNwICIgERAQUBChIGARIICohVAQMLB?= =?us-ascii?q?QgOoxI/jAKCAwUBHIMJBYNkChknAwpVgi4BCgEBAQEbAgYShXWFMoR2glmCXgW?= =?us-ascii?q?HKQyIcIsjhmGLBIJJjiWRKhQegRQPJ4E4Eh1PFIQnHIFjOzWJNAEBAQ?= X-IPAS-Result: =?us-ascii?q?A0BDCQBlf4FYf8HZVdFeHAEFAQsBg0ABAQEBAUE0CoEJB4N?= =?us-ascii?q?MmmkGgR2CNoY+jkQshXYCgXoHQxABAQEBAQEBAQEBARIBAQkLCwobMoIzG4IcA?= =?us-ascii?q?QQBIx0BGxgGAwELBgULNwICIgERAQUBChIGARIICohVAQMLBQgOoxI/jAKCAwU?= =?us-ascii?q?BHIMJBYNkChknAwpVgi4BCgEBAQEbAgYShXWFMoR2glmCXgWHKQyIcIsjhmGLB?= =?us-ascii?q?IJJjiWRKhQegRQPJ4E4Eh1PFIQnHIFjOzWJNAEBAQ?= X-IronPort-AV: E=Sophos;i="5.33,257,1477954800"; d="scan'208,217";a="210050990" Received: from mail-ua0-f193.google.com ([209.85.217.193]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/AES128-GCM-SHA256; 20 Jan 2017 04:13:02 +0100 Received: by mail-ua0-f193.google.com with SMTP id 96so6105458uaq.2 for ; Thu, 19 Jan 2017 19:13:02 -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=xUXK1AZoT129ZoZucTuYh+Bg0awaH5jCNnB1N52ykNk=; b=aKsEeJBzBAxN2IfV4wzoVnr/zOcT7gWMda/Lpg7VBnXTlTZQKx5XvPjPK+WcoQPKNU ESbDuaB2UmytSTDwmtYXOUIFd9InzBv/nM/WePIK4twFQyi4wJB6vNgnde8IudE+jGFI RXuuvv2Xrq6JaZmVdvs2pBGId3Qz8BleiD5izIHbUpD7fA10Isxs1qo4KT4UrGPaQMLy pAxMchhfwfGOxYZAf7W1hgrUxu5MJW26/N6idsHZuJ4Pc3PJE840rw69BKvDjt9Q03Wd ZoaCvLKztnitQbMZs7RVuXIzLBx6DDsGjL36eGiyDi8Xrnd/BlGSlSF3+JaC3JLXjRoF DVZQ== 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=xUXK1AZoT129ZoZucTuYh+Bg0awaH5jCNnB1N52ykNk=; b=TphY2O3QivKxmQ90LXxLqgaFz1vcIxm/Tu05iJ3XNomeBwyNxk2h4QgV0ja81RsQ1p x7VKb/kzwTG3mJbtYK4uysHqcklwOuQPNpVxpQPAzVGBojPvNjxAXyvEjg+4kbK9iUH9 +3O2MOmvoFUyubP3GCBx7BY86JHCj9gy70rvuCgcsVVXHoO/bdK5vZIU7zMdFBkySk1j LghtgrqsjOd6LN60pq3kLaMEztoTvIk3NrTJUy1EWijSjA8WA/xX9Yx7jXDyMZGy1q7W W0+yfNUSi05v07kQVjbdCO4qTvoZejSVCYbjdDgmWBKXSiPNCFOGnXPpjMBxLGs9DdaW eu0g== X-Gm-Message-State: AIkVDXJ+y9fUTpzkkrdlr31KnbTf5AO5HXR9cj+e0EjXyhdwMCwj21a5BFTK1yuLFrq9GU7OE17jUIOv19mepQ== X-Received: by 10.176.64.168 with SMTP id i37mr6553145uad.60.1484881980644; Thu, 19 Jan 2017 19:13:00 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.91.214 with HTTP; Thu, 19 Jan 2017 19:13:00 -0800 (PST) In-Reply-To: <20170118212008.GA2179@Magus.localnet> References: <20170118212008.GA2179@Magus.localnet> From: Eray Ozkural Date: Fri, 20 Jan 2017 06:13:00 +0300 Message-ID: To: Oleg , Eray Ozkural , Caml List Content-Type: multipart/alternative; boundary=94eb2c122bb4fd638e05467e06a0 Subject: Re: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0 --94eb2c122bb4fd638e05467e06a0 Content-Type: text/plain; charset=UTF-8 On Thu, Jan 19, 2017 at 12:20 AM, Oleg wrote: > > > 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? > > I guess you are asking about the complexity and overhead of building > code representations (because otherwise, MetaOCaml is an ordinary > OCaml program, and could be optimized as such). Code values have a > somewhat complex representation because they also describe all > future-stage free variables that occur within the value. The data > structure used to represent free variable is designed to be > efficient. Long time ago I did a spot test of generating code with 100 > free variables. I could not detect any overhead due to the handling of > free variables. Thus in my experience, MetaOCaml-specific overhead is > rather negligible. If there is a real need to get MetaOCaml to generate > code as fast as possible, one should optimize MetaOCaml as any other > OCaml program. Yes, I might also be asking about the complexity of designing an extremely fast / ideal runtime system. [Ocaml's bytecode and interpreter is nice, but it is not quite what I would do. Anyhow, that's off-topic.] I'm glad to hear there isn't major overhead with free variables, that would be a potential bottleneck. That's quite nice and encouraging. > > You may also be asking about the performance of Runcode.run. It > includes compiling the code and running the resulting > bytecode. Compilation does impose overhead. How to reduce it is a > complex question. For now I remark that the generated code is usually > rather simple. One could compile it with rather old version of OCaml, > which was really fast. > I did think at length on how to do that with code generated on the fly. It seemed like there is some unavoidable costs associated with the usual, like type-checking of course. I had considered metaocaml for my AGI codebase once, now I will think again, thanks for your remarks. My code is written in ocaml, so I do try to evaluate every significant ocaml technology developed. Let's stay at the cutting edge, and many thanks for your awesome contributions again! https://github.com/metaocaml/ber-metaocaml/blob/ber-n104/metalib/runcode.ml Celebrating Oleg's cyber poetry here ^_^ Best, -- Eray Ozkural, PhD. Computer Scientist Founder, Gok Us Sibernetik Ar&Ge Ltd. http://groups.yahoo.com/group/ai-philosophy --94eb2c122bb4fd638e05467e06a0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable


On Thu, Jan 19, 2017 at 12:20 AM, Oleg <oleg@okmij.org> wro= te:

> 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<= br> > think if that is possible at all?

I guess you are asking about the complexity and overhead of building=
code representations (because otherwise, MetaOCaml is an ordinary
OCaml program, and could be optimized as such). Code values have a
somewhat complex representation because they also describe all
future-stage free variables that occur within the value. The data
structure used to represent free variable is designed to be
efficient. Long time ago I did a spot test of generating code with 100
free variables. I could not detect any overhead due to the handling of
free variables. Thus in my experience, MetaOCaml-specific overhead is
rather negligible. If there is a real need to get MetaOCaml to generate
code as fast as possible, one should optimize MetaOCaml as any other
OCaml program.

Yes, I might also be asking = about the complexity of designing an extremely fast / ideal runtime system.= [Ocaml's bytecode and interpreter is nice, but it is not quite what I = would do. Anyhow, that's off-topic.]
=C2=A0
I'm= glad to hear there isn't major overhead with free variables, that woul= d be a potential bottleneck. That's quite nice and encouraging.=C2=A0

You may also be asking about the performance of Runcode.run.=C2=A0 It
includes compiling the code and running the resulting
bytecode. Compilation does impose overhead. How to reduce it is a
complex question. For now I remark that the generated code is usually
rather simple. One could compile it with rather old version of OCaml,
which was really fast.

I did think at l= ength on how to do that with code generated on the fly. It seemed like ther= e is some unavoidable costs associated with the usual, like type-checking o= f course. I had considered metaocaml for my AGI codebase once, now I will t= hink again, thanks for your remarks. My code is written in ocaml, so I do t= ry to evaluate every significant ocaml technology developed. Let's stay= at the cutting edge, and many thanks for your awesome contributions again!=


Ce= lebrating Oleg's cyber poetry here ^_^

Best,= =C2=A0

--
Eray= Ozkural, PhD. Computer Scientist
Founder, Gok Us Sibernetik Ar&Ge L= td.
http://groups.yahoo.com/group/ai-philosophy
--94eb2c122bb4fd638e05467e06a0--