caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Eray Ozkural <examachine@gmail.com>
To: Oleg <oleg@okmij.org>, Eray Ozkural <examachine@gmail.com>,
	Caml List <caml-list@inria.fr>
Subject: Re: [Caml-list] ANN: BER MetaOCaml N104, for OCaml 4.04.0
Date: Fri, 20 Jan 2017 06:13:00 +0300	[thread overview]
Message-ID: <CA+rXZpbFSWpoCXQZypJUXjSKbpiDSQii0sZZ05sDJtyQTPN2rQ@mail.gmail.com> (raw)
In-Reply-To: <20170118212008.GA2179@Magus.localnet>

[-- Attachment #1: Type: text/plain, Size: 2462 bytes --]

On Thu, Jan 19, 2017 at 12:20 AM, Oleg <oleg@okmij.org> 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

[-- Attachment #2: Type: text/html, Size: 3551 bytes --]

      reply	other threads:[~2017-01-20  3:13 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
2017-01-20  3:13     ` Eray Ozkural [this message]

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=CA+rXZpbFSWpoCXQZypJUXjSKbpiDSQii0sZZ05sDJtyQTPN2rQ@mail.gmail.com \
    --to=examachine@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=oleg@okmij.org \
    /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).