Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Byte-code -> native code conversion?
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Warp <warplayer@f...>
Subject: Re: [Caml-list] Byte-code -> native code conversion?
> In theory, is it possible to "convert" a Caml byte-code program into
> a native executable (without the source code of that program being
> available)?
>
> I'm wondering if it would be possible to distribute Caml programs in
> byte-code format for portability, and the user may then choose to compile
> the program to native code for speed.
>
> Is this possible?  Difficult?  Any thoughts?

I think it won't be too much difficult to write a virtual machine which will
convert on-the-flow ocaml bytecode into native asm code, and then call it.
But seems like much efforts have been made in register assignation of the
ocaml interpreter ( under GCC ) to make the interpreter running faster, so
you can use bytecode compilation without a big speed loss.

Anyway, ocaml bytecode "translated" to native asm won't be as much optimized
as native can be.

Warp

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr