caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Fabrice Le Fessant <fabrice.le_fessant@inria.fr>
To: "Alex Baretta" <alex@baretta.com>
Cc: "Ocaml Mailing List" <caml-list@inria.fr>
Subject: Re: R: Ocaml VM and bytecode
Date: Mon, 29 Jan 2001 00:21:21 +0100 (CET)	[thread overview]
Message-ID: <14964.43377.541763.504223@cremant.inria.fr> (raw)
In-Reply-To: <006b01c08879$7241a920$a2ab6ed4@alex>


The -dinstr instruction causes the ocamlc compiler to output
(pretty-print) the list of bytecode instructions used to compile a
module. For example,

# cat > test.ml
let x = 3;;
^D
# ocamlc -c -dinstr test.ml
        const 3
        push
        acc 0
        makeblock 1, 0
        pop 1
        setglobal Test!

where the last 6 lines are the instructions generated for test.ml in
test.cmo. My patch allows to give such a file (in .ocb) to ocamlc to 
directly generate the .cmo file. By compiling to these instructions,
you will be able to generate .cmo files for any languages (the problem
of interfaces is not solved yet however).

For more information on the bytecode, you should have a look to the
ZINC paper of Xavier Leroy, and to sources of ocaml (such as
byterun/interp.c and bytecomp/printinstr.ml).

Regards,

- Fabrice



  reply	other threads:[~2001-01-31 10:54 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-01-27 15:54 Alex Baretta
2001-01-28 23:21 ` Fabrice Le Fessant [this message]
2001-01-30 20:01 Alex Baretta

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=14964.43377.541763.504223@cremant.inria.fr \
    --to=fabrice.le_fessant@inria.fr \
    --cc=alex@baretta.com \
    --cc=caml-list@inria.fr \
    /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).