From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id LAA14212 for caml-red; Wed, 31 Jan 2001 11:54:38 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id AAA27158 for ; Mon, 29 Jan 2001 00:21:38 +0100 (MET) Received: from cremant.inria.fr (cremant.inria.fr [128.93.8.143]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f0SNLW516269; Mon, 29 Jan 2001 00:21:32 +0100 (MET) Received: (from lefessan@localhost) by cremant.inria.fr (8.11.0/8.11.0) id f0SNLNK04229; Mon, 29 Jan 2001 00:21:23 +0100 X-Authentication-Warning: cremant.inria.fr: lefessan set sender to fabrice.le_fessant@inria.fr using -f From: Fabrice Le Fessant MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <14964.43377.541763.504223@cremant.inria.fr> Date: Mon, 29 Jan 2001 00:21:21 +0100 (CET) To: "Alex Baretta" Cc: "Ocaml Mailing List" Subject: Re: R: Ocaml VM and bytecode References: <006b01c08879$7241a920$a2ab6ed4@alex> X-Mailer: VM 6.75 under Emacs 20.7.1 Reply-To: fabrice.le_fessant@inria.fr Sender: weis@pauillac.inria.fr 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