Date: Fri, 5 Mar 1999 15:12:34 +0100
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Hugh Sasse <email@example.com>, firstname.lastname@example.org
Subject: Re: ocaml not native.
In-Reply-To: <Pine.GSU.email@example.com>; from Hugh Sasse on Thu, Mar 04, 1999 at 04:31:10PM +0000
> 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
Hope this helps,
- Xavier Leroy
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:20 MET