caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* R: Ocaml VM and bytecode
@ 2001-01-30 20:01 Alex Baretta
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Baretta @ 2001-01-30 20:01 UTC (permalink / raw)
  To: Sylvain Kerjean, Ocaml Mailing List

As far as I can see, the options you mention are not documented in the
manual. Do you (are anybody else) know where I could find
documentation on the topic?

Alex


-----Messaggio originale-----
Da: Sylvain Kerjean <skerjean@irisa.fr>
A: Alex Baretta <alex@baretta.com>
Data: lunedì 29 gennaio 2001 11.43
Oggetto: Re: Ocaml VM and bytecode


Alex Baretta wrote:
>
> Is there such a thing as an assembly language -- and the matching
> assembler -- for the Ocaml VM?

Have you ever tried to launch ocaml with options -dinstr or -dlambda ?

;-)
--
Sylvain Kerjean
IRISA-INRIA, Campus de Beaulieu, 35042 Rennes cedex, France
Tél: +33 (0) 2 99 84 75 99, Fax: +33 (0) 2 99 84 71 71



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: R: Ocaml VM and bytecode
  2001-01-27 15:54 Alex Baretta
@ 2001-01-28 23:21 ` Fabrice Le Fessant
  0 siblings, 0 replies; 3+ messages in thread
From: Fabrice Le Fessant @ 2001-01-28 23:21 UTC (permalink / raw)
  To: Alex Baretta; +Cc: Ocaml Mailing List


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



^ permalink raw reply	[flat|nested] 3+ messages in thread

* R: Ocaml VM and bytecode
@ 2001-01-27 15:54 Alex Baretta
  2001-01-28 23:21 ` Fabrice Le Fessant
  0 siblings, 1 reply; 3+ messages in thread
From: Alex Baretta @ 2001-01-27 15:54 UTC (permalink / raw)
  To: fabrice.le_fessant, Ocaml Mailing List


-----Messaggio originale-----
Da: Fabrice Le Fessant <fabrice.le_fessant@inria.fr>
A: Alex Baretta <alex@baretta.com>
Cc: sebastien.ailleret@inria.fr <sebastien.ailleret@inria.fr>; Ocaml
Mailing List <caml-list@inria.fr>
Data: venerdì 26 gennaio 2001 14.16
Oggetto: Re: Ocaml VM and bytecode


>
>Here is a patch to lattest ocaml CVS version, allowing direct
>compilation of text bytecode instructions to .cmo files.
>
>Text bytecode instructions files should have extension .ocb
(Objective
>Caml Bytecode), and have the same format as the output from ocamlc
>with -dinstr.


I have read the ocamlc manual page, but I have not found the -dinstr
option you mention. What is it supposed to do? Is it supposed to
generate Ocaml "assembly" language? Is the "text bytecode" you mention
the "assembly language" I am asking for?

Thanks for taking interest to my request.


Alex



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-01-31 16:28 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-01-30 20:01 R: Ocaml VM and bytecode Alex Baretta
  -- strict thread matches above, loose matches on Subject: below --
2001-01-27 15:54 Alex Baretta
2001-01-28 23:21 ` Fabrice Le Fessant

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