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 IAA02851 for caml-redistribution; Mon, 8 Mar 1999 08:42:08 +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 PAA00814 for ; Fri, 5 Mar 1999 15:12:47 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id PAA20087; Fri, 5 Mar 1999 15:12:34 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id PAA03280; Fri, 5 Mar 1999 15:12:34 +0100 (MET) Message-ID: <19990305151234.02368@pauillac.inria.fr> Date: Fri, 5 Mar 1999 15:12:34 +0100 From: Xavier Leroy To: Hugh Sasse , caml-list@inria.fr Subject: Re: ocaml not native. References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: ; from Hugh Sasse on Thu, Mar 04, 1999 at 04:31:10PM +0000 Sender: weis > ocamlopt builds successfully on my systems. Is there a reason why > the installation doesn't rebuild ocaml to be native code, when it can? > Is there a good reason not to attempt this myself? There is a good reason why it wouldn't work: ocaml is not an interpreter, it's a bytecode compiler that generates bytecode on the fly for each phrase. So, ocaml needs the bytecode interpreter. Compiling it with ocamlopt would require an emulation of the bytecode interpreter that can be used with ocamlopt. One such emulation exists (written by Fabrice Le Fessant), but is not yet integrated with the toplevel, and also runs slower than the bytecode interpreter itself. However, there is a simpler solution to the double #! problem: build a custom toplevel with no extensions: ocamlmktop -custom -o /usr/local/bin/ocaml2 This packages the (bytecode) toplevel system with the runtime system, in such a way that, viewed from the kernel, /usr/local/bin/ocaml2 is a native executable. Then, you can write scripts with #!/usr/local/bin/ocaml2 Hope this helps, - Xavier Leroy