caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Oleg <oleg@okmij.org>
To: examachine@gmail.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0
Date: Thu, 19 Jan 2017 06:20:08 +0900	[thread overview]
Message-ID: <20170118212008.GA2179@Magus.localnet> (raw)
In-Reply-To: <CA+rXZpb0QBfCefCyUW6D2b+njT-+jtuAqcCamHLpL-iDF57xGA@mail.gmail.com>


> 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.

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.

        Cheers,
        Oleg


  parent reply	other threads:[~2017-01-18 21:19 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-01 15:20 Oleg
2017-01-01 16:03 ` Gabriel Scherer
2017-01-01 19:25   ` Manfred Lotz
2017-01-01 19:34     ` Gabriel Scherer
2017-01-01 20:06       ` Manfred Lotz
2017-01-15  8:55   ` Oleg
2017-01-14 12:10 ` Eray Ozkural
2017-01-16 13:18 ` Eray Ozkural
2017-01-16 13:25   ` Gabriel Scherer
2017-01-16 17:12     ` Eray Ozkural
2017-01-18 21:20   ` Oleg [this message]
2017-01-20  3:13     ` Eray Ozkural

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170118212008.GA2179@Magus.localnet \
    --to=oleg@okmij.org \
    --cc=caml-list@inria.fr \
    --cc=examachine@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).