From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA06273 for caml-redistribution@pauillac.inria.fr; Mon, 21 Feb 2000 18:03:38 +0100 (MET) Resent-Message-Id: <200002211703.SAA06273@pauillac.inria.fr> 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 KAA04574 for ; Fri, 18 Feb 2000 10:36:07 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id KAA21448; Fri, 18 Feb 2000 10:36:05 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA17647; Fri, 18 Feb 2000 10:36:03 +0100 (MET) Message-ID: <20000218103603.51298@pauillac.inria.fr> Date: Fri, 18 Feb 2000 10:36:03 +0100 From: Xavier Leroy To: Gerd.Stolpmann@darmstadt.netsurf.de, Claude Marche , caml-list@inria.fr Subject: Re: Portability of applications written in OCAML References: <14505.19990.196972.627775@sun-demons> <00021700444302.30469@ice> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <00021700444302.30469@ice>; from Gerd Stolpmann on Wed, Feb 16, 2000 at 11:49:22PM +0100 Resent-From: weis@pauillac.inria.fr Resent-Date: Mon, 21 Feb 2000 18:03:38 +0100 Resent-To: caml-redistribution@pauillac.inria.fr Claude Marche asks: >One idea could be distributing bytecode: is it true the any bytecode >can be executed on any architecture and OS as soon as the right >ocamlrun is used? (Even under non unix OSs like Microsoft-Windows or >Mac-OS?) For MacOS, there are some problems with end-of-line being represented by different control characters in MacOS and in Unix and Windows. So, newlines in program output are broken. For MacOS and Windows, there is also the fact that file path names are represented differently. So, if your program manipulates file names, even though the Filename module, the bytecode may not work well under a different OS. I think the easiest way to distribute an OCaml application is as sources, plus binaries for a couple of popular architectures (typically, Linux/Intel and Windows). Novice users can pick the binaries, and experienced users should have no problems installing OCaml for compiling your application. Gerd Stolpmann wrote: > My suggestion: Every modern operating system can link libraries dynamically. > This is also possible for the parts of the OCaml libraries written in C > which need to be available in the runtime system. Right, I have been considering dynamic loading of C libraries as an alternative to -custom. This would allow, among other benefits, dynamic loading of Caml libraries that contain some C code. There are some portability issues with old or exotic versions of Unix, but I think it can be made to work under, say, Linux, Solaris, Digital/Tru64 Unix, and Windows. There are some issues still to be resolved, however, such as how to build shared C libraries in a portable fashion, perhaps by using the GNU libtool package. > - Only libraries needed for the application are loaded into memory; > the memory footprints become much smaller Yes and no, because static linking under C is able to remove members of the .a archive that are not referenced, while dynamic loading typically loads everything. But memory footprint of code is not much of an issue these days. - Xavier Leroy