Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] Alternative Bytecodes for OCaml
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Raphael Montelatici <rmontelatici@l...>
Subject: Re: [Caml-list] Alternative Bytecodes for OCaml
Hi all,
Here are some explanations on OcamIL.
OcamIL compiles Ocaml programs to verifiable MSIL bytecode.
I  have not advertised at all about it so far because I still consider it is
not mature yet.

Some implementation details:
OcamIL is a modified ocamlopt compiler. Modifications are made as late as
possible in order to achieve maximum compatibility with ocamlc/opt. One big
issue is the compilation of an untyped intermediate language to a typed
runtime.

Two tracks have been followed : 1) type reconstruction and 2) type
propagation
1) The current OcamIL distribution relies on the first approach. It gives
enough good results to allow to bootstrap OCamIL and build an Ocaml
toplevel for .NET. Interoperability with C# has been successfully tested.
2) However, it leads to unadequate data representations that entail poor
performance. I'm currently working on the second approach.
This involves a lot of code restructuration. Source files (as a patch to
ocaml sources) together with a correct license will appear in the next
release (expected late october ?)

About interoperability:
We do not want to add weird FFI features to the Ocaml syntax. We prefer an
IDL approach, inspired by what have been done for Caml and Java by the
OJacare project ( http://www.pps.jussieu.fr/~henry/ojacare/index.en.html ).

About mono:
OcamIL is developped and tested on windows, but I'm willing to make it
compatible with Mono.
However, mono still lacks .NET compatibility. OcamIL relies on parts of the
Reflection library that are not available yet.
Moreover, the mono bytecode interpreters behaves strangely: some executables
produced by OcamIL don't run in the bytecode interpreter, but do run when
previously compiled by the mono bytecode-to-nativecode compiler.
Please Mono users wait for the next OcamIL release, which will be announced
on this list.

Raphael Montelatici





----- Original Message ----- 
From: "John Goerzen" <jgoerzen@complete.org>
To: <caml-list@inria.fr>
Cc: <Emmanuel.Chailloux@pps.jussieu.fr>;
<Raphael.Montelatici@pps.jussieu.fr>
Sent: Wednesday, August 25, 2004 5:02 PM
Subject: Re: [Caml-list] Alternative Bytecodes for OCaml


> [ I'm CCing the people listed as contacts on the OCamil page; I hope you
> don't mind ]
>
> On Wednesday 25 August 2004 09:50 am, John Goerzen wrote:
> > On Wednesday 25 August 2004 09:38 am, Richard Jones wrote:
> > > On Wed, Aug 25, 2004 at 09:26:28AM -0500, John Goerzen wrote:
> > > >  * An ocamlc/ocamlrun that execute under Java or .NET and
> > > > compile/run normal OCaml bytecode
> > >
> > > This interesting project was posted on the Wiki yesterday.  It
> > > generates code which runs on the .NET CLR.  I'm not exactly sure
> > > how, whether it's a modified compiler, or a translator of OCaml
> > > bytecode:
> > >
> > > http://www.pps.jussieu.fr/~montela/ocamil/
> >
> > That is indeed interesting.  It looks like they have a good start.
> > Unfortunately, there's one huge problem: there is no source code at
> > all.  (Doesn't that violate the OCaml license?)
>
> This is a very important point, BTW.
>
> I have been able to take their binaries and see at least something
> happen with Mono:
>
> $ mono ocamiltop.exe
>
> ** ERROR **: Invalid IL code at IL0096 in Nativeint.Top:start ():
> IL_0096: shl
>
> Well, it's a start.  With source, I could probably do a lot more.
>
> > They are working in a pure Windows environment and have yet to port
> > some libraries such as Str and Unix.  These are both things I can
> > help with, but without the source code, it's completely useless to
> > me.
> >
> > > What will be interesting will be to see how well it allows one to
> > > call .NET libraries, and how well it works on Mono.
> >
> > Indeed.  (And how well it allows other .NET programs to call OCaml
> > code.)
> >
> > -- John
> >
> > -------------------
> > To unsubscribe, mail caml-list-request@inria.fr Archives:
> > http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs
> > FAQ: http://caml.inria.fr/FAQ/ Beginner's list:
> > http://groups.yahoo.com/group/ocaml_beginners
>

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners