caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Joel Reymont <joelr1@gmail.com>
To: Jon Harrop <jon@ffconsultancy.com>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] High-performance bytecode interpreter in OCaml
Date: Thu, 16 Aug 2007 00:26:49 +0100	[thread overview]
Message-ID: <3C3EDB59-44C1-4C3A-AD96-C762B986F39C@gmail.com> (raw)
In-Reply-To: <200708151618.38165.jon@ffconsultancy.com>

On Aug 15, 2007, at 4:18 PM, Jon Harrop wrote:

>   let rec compile bytecode = match bytecode with
>     | 0x83::x::t ->
>         let x = String.lowercase (string_of_int x) in
>         let t = compile t in
>         (fun k -> print_string x; k t)

I'm curious, would this be any faster than doing whatever the 0x83  
opcode requires and then just invoking (compile t)?

Does it actually make sense to convert the whole bytecode file into a  
chain of closures and then execute it repeatedly? Would there be a  
huge gain compared to interpreting every time?

I guess it would make sense if closures could be compiled into  
machine code "just in time" or if my VM was compiled using ocamlopt.  
I'm not sure, though, so I'm looking for input.

	Thanks, Joel

--
http://wagerlabs.com






  reply	other threads:[~2007-08-15 23:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 11:49 Joel Reymont
2007-08-15 13:01 ` [Caml-list] " Jon Harrop
2007-08-15 13:20   ` Joel Reymont
2007-08-15 15:18     ` Jon Harrop
2007-08-15 23:26       ` Joel Reymont [this message]
2007-08-16  3:58         ` Jon Harrop
2007-08-15 23:31     ` Grant Olson
2007-08-16 15:55       ` Jon Harrop

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=3C3EDB59-44C1-4C3A-AD96-C762B986F39C@gmail.com \
    --to=joelr1@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=jon@ffconsultancy.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).