From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Hugh Sasse <hgs@dmu.ac.uk>, caml-list@inria.fr
Subject: Re: ocaml not native.
Date: Fri, 5 Mar 1999 15:12:34 +0100 [thread overview]
Message-ID: <19990305151234.02368@pauillac.inria.fr> (raw)
In-Reply-To: <Pine.GSU.4.04.9903041603210.26819-100000@helios.dmu.ac.uk>; 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
#!/usr/local/bin/ocaml2
Hope this helps,
- Xavier Leroy
prev parent reply other threads:[~1999-03-08 7:42 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1999-03-04 16:31 Hugh Sasse
1999-03-05 8:27 ` Fabrice Le Fessant
1999-03-05 14:12 ` Xavier Leroy [this message]
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=19990305151234.02368@pauillac.inria.fr \
--to=xavier.leroy@inria.fr \
--cc=caml-list@inria.fr \
--cc=hgs@dmu.ac.uk \
/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