caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: David Gurr <gurr@mrs.med.ge.com>
To: frisch@clipper.ens.fr
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] OCaml runtime system and Java
Date: Thu, 5 Apr 2001 18:30:33 -0700 (PDT)	[thread overview]
Message-ID: <200104060130.SAA01300@mrs.mrs.med.ge.com> (raw)


> It seems than a few OCaml users have considered various approaches for
> running Caml programs on the Java VM. Has there been some attempt to do
> it the other way round, that is to run Java on the OCaml runtime system ?

Yes.  It is much better than the other directions.  But boxing 32 bit 
ints is a killer on 32 bit machines.  So your compiler ... .

> It could be with the full OCaml VM, or maybe more realistically, with a
> specialized VM using only the OCaml memory model (GC and block layout)
> and thread scheduling. Would it be difficult to implement (in C for
> instance) a Java VM on top of the OCaml runtime system ?

Yes (well more like tedious).  Java has lots of cruft.  For example JNI. 
And what would you do with 32 bit ints on 32 bit machines?  You
could extend custom blocks with garbage collection ops, but then what is
left of the ocaml runtime? 

A third idea, modify the instruction set of a JVM, add tagged ints, and
boot the verifier.  In Harrisa, I'm adding to and/or replacing the JVM
instructions with ZAM instructions (and translating class files to cmo
files).  The point is not a better way to run ML ('cause dis aint it),
but to ease migration from java to ML.  If it works I will do it again
on a java 1.3 implementation.  Will I miss the ocaml garbage
collector?  Yes.  Will something need to be done?  I expect so. I will
try adding ocaml's minor heap as a first step.

My other hack is to revive Camloo.  Camloo is the front end of
caml-light and the back end of Bigloo.  It compiled caml-light to C
with good interop with C and Scheme.  Bigloo now compiles to either C
or JVM.  Bigloo compiles modules and does lots of optimization.  I
expect that it satifactorily deals with the faults of JVM.

Before anyone points out the drawbacks of "O'Camloo", let me say that I
am impressed with both Ocaml and Bigloo.  They are based on very
different strategies toward dealing with a world dominated by C and
Unix.  Both are very successful.  While I am at it, I will say that I
am also impressed with MLj.  I agree with gerd's take on MLj but unlike
Bigloo and Ocaml, MLj died young and for reasons other than its own
virtues.  If MLj was as old and refined as Bigloo and Ocaml, it would
be quite good.  For example the whole program only & slow compile
disappear if you add a second backend that targets ZAM.  And this is
not difficult. Even in its current state it is well worth using
for the cases where it makes sense.

-D

PS this is a hobby project so no promises on when I will have
anything nor that it will be worth distributing tho it will
be free if it is distributed.
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


             reply	other threads:[~2001-04-06  1:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-04-06  1:30 David Gurr [this message]
  -- strict thread matches above, loose matches on Subject: below --
2001-04-05 22:08 Alain Frisch
2001-04-06  0:27 ` Jacques Garrigue

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=200104060130.SAA01300@mrs.mrs.med.ge.com \
    --to=gurr@mrs.med.ge.com \
    --cc=caml-list@inria.fr \
    --cc=frisch@clipper.ens.fr \
    /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;
as well as URLs for NNTP newsgroup(s).