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 TAA00318; Thu, 5 Apr 2001 19:37:08 +0200 (MET DST) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id TAA00332 for caml-list@pauillac.inria.fr; Thu, 5 Apr 2001 19:37:08 +0200 (MET DST) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id XAA00159 for ; Tue, 3 Apr 2001 23:05:28 +0200 (MET DST) Received: from moutvdom00.kundenserver.de (moutvdom00.kundenserver.de [195.20.224.149]) by concorde.inria.fr (8.11.1/8.10.0) with ESMTP id f33L5Qf24301 for ; Tue, 3 Apr 2001 23:05:26 +0200 (MET DST) Received: from [195.20.224.220] (helo=mrvdom04.kundenserver.de) by moutvdom00.kundenserver.de with esmtp (Exim 2.12 #2) id 14kXzT-0005dY-00; Tue, 3 Apr 2001 23:05:27 +0200 Received: from drms-3e35780c.pool.mediaways.net ([62.53.120.12] helo=ice.gerd-stolpmann.de) by mrvdom04.kundenserver.de with esmtp (Exim 2.12 #2) id 14kXzM-0002Z8-00; Tue, 3 Apr 2001 23:05:20 +0200 Received: from localhost (localhost [[UNIX: localhost]]) by ice.gerd-stolpmann.de (8.9.3/8.9.3) id XAA28167; Tue, 3 Apr 2001 23:05:15 +0200 From: Gerd Stolpmann Reply-To: gerd@gerd-stolpmann.de Organization: privat To: Chris Hecker , Martin Berger Subject: Re: [Caml-list] ocaml, java, rmi and jini Date: Tue, 3 Apr 2001 22:50:49 +0200 X-Mailer: KMail [version 1.0.28] Content-Type: text/plain Cc: caml-list@inria.fr References: <15049.51482.197252.672850@pc803> <4.3.2.7.2.20010403121826.03425d50@shell16.ba.best.com> In-Reply-To: <4.3.2.7.2.20010403121826.03425d50@shell16.ba.best.com> MIME-Version: 1.0 Message-Id: <01040323051504.00489@ice> Content-Transfer-Encoding: 8bit Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk On Tue, 03 Apr 2001, Chris Hecker wrote: >>hi there, i'm interested in integrating java and jini with ocaml. i >>understand that executing ocaml bytecode on JVMs might not be a >>good idea > >Have you seen this? >http://www.ocaml-programming.de/javacaml/manual/ > >I'd love to be able to either compile ocaml to JVM bytecodes (yes, I know it's hard) >or have the javacaml system provide good access to some of the java libraries >(some graphics, mouse/keyboard, simple UI, networking). Is Gerd reading this? Yes. >I sent mail about the status of javacaml a while back, but haven't heard >anything yet. Sorry that I sometimes cannot reply immediately. >I'm interested in this because I want to write relatively >simple web applets in ocaml, so javacaml would be find for me. I assume >anybody who wants to actually deliver a production app for a JVM would need a >better solution. Javacaml has very poor performance, and I think it is impossible to change that. Even if we compile to Java bytecode directly. The point is that Java bytecode is very restrictive due to its sandbox principle, and this makes it impossible to map a different programming style to the code structure needed by the JVM. For example, there is no "goto" in the JVM, but we need it for tail recursion. Another problem are closures. There is no direct equivalent in Java; you can only define classes that contain the implicit closure variables as instance variables, and that have an "apply" method. This is a very expensive mapping, and even if Java can deal with many classes, I don't believe that it can deal with that many classes we would need to run Caml programs (usually containing lots of closures). Perhaps there is a scheme that maps from Caml to Java, but you would need extensive program analysis to optimize the code. Of course, it is still possible to use the current JavaCaml implementation, and to extend it. However, I must warn you. "Some graphics, mouse/keyboard, simple UI, networking" would require more performance than this emulation can give you, even with execellent JIT compilers and fast CPUs. It's only several thousand bytecode instructions per second. Gerd -- ---------------------------------------------------------------------------- Gerd Stolpmann Telefon: +49 6151 997705 (privat) Viktoriastr. 100 64293 Darmstadt EMail: gerd@gerd-stolpmann.de Germany ---------------------------------------------------------------------------- ------------------- To unsubscribe, mail caml-list-request@inria.fr. Archives: http://caml.inria.fr