From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id DAA07570; Fri, 6 Apr 2001 03:31:15 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id DAA07302 for ; Fri, 6 Apr 2001 03:31:13 +0200 (MET DST) Received: from ext-ch1gw-2.online-age.net (ext-ch1gw-2.online-age.net [216.34.191.36]) by nez-perce.inria.fr (8.11.1/8.10.0) with ESMTP id f361VC509114 for ; Fri, 6 Apr 2001 03:31:12 +0200 (MET DST) Received: from int-ch1gw-3.online-age.net (int-ch1gw-3 [3.159.232.67]) by ext-ch1gw-2.online-age.net (8.9.3+Sun/8.9.1/990426-RLH) with ESMTP id VAA02330; Thu, 5 Apr 2001 21:31:09 -0400 (EDT) Received: from uswaumsxb4medge.med.ge.com (localhost [127.0.0.1]) by int-ch1gw-3.online-age.net (8.9.3+Sun/8.9.1/990426-RLH) with ESMTP id VAA25254; Thu, 5 Apr 2001 21:31:09 -0400 (EDT) Received: by USWAUMSXB4MEDGE with Internet Mail Service (5.5.2653.19) id <2C6CSVK3>; Thu, 5 Apr 2001 20:31:08 -0500 Received: from mrs.mrs.med.ge.com (MRS [3.57.196.1]) by uswaumsxbhmedge.med.ge.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2653.13) id 2C6CHSMR; Thu, 5 Apr 2001 20:31:02 -0500 Received: (from gurr@localhost) by mrs.mrs.med.ge.com (8.9.3+Sun/8.9.3) id SAA01300; Thu, 5 Apr 2001 18:30:33 -0700 (PDT) From: David Gurr To: frisch@clipper.ens.fr Cc: caml-list@inria.fr Date: Thu, 5 Apr 2001 18:30:33 -0700 (PDT) Message-Id: <200104060130.SAA01300@mrs.mrs.med.ge.com> Subject: Re: [Caml-list] OCaml runtime system and Java X-Sun-Charset: US-ASCII Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > 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