From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA21400 for caml-redist; Tue, 25 Apr 2000 18:57:37 +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 VAA02311 for ; Fri, 21 Apr 2000 21:00:00 +0200 (MET DST) 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 UAA03120; Fri, 21 Apr 2000 20:59:59 +0200 (MET DST) Received: (from vouillon@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id UAA20386; Fri, 21 Apr 2000 20:59:58 +0200 (MET DST) Message-ID: <20000421205958.36133@pauillac.inria.fr> Date: Fri, 21 Apr 2000 20:59:58 +0200 From: Jerome Vouillon To: Nicolas GEORGE , caml-list@inria.fr Subject: Re: Dynamic link References: <20000420103349.A12329@galion.ens.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <20000420103349.A12329@galion.ens.fr>; from Nicolas GEORGE on Fri, Apr 21, 2000 at 07:13:00PM +0200 Sender: weis On Fri, Apr 21, 2000 at 07:13:00PM +0200, Nicolas GEORGE wrote: > I have written a small patch to the OCaml (2.99) run-time, that enables to > dynamically load C primitives, instead to have to link against a custom > run-time. It is far from perfect, but at this time, it works (under Unix > systems). [...] > One main advantage is to can use OCaml for small applications (such as > simple front-ends) that needs special libraries (GUI, Unix, Str...) without > the 1/2 megabyte of the custom run-time. Actually, if you are concerned about the size of a custom runtime, it is much simpler to patch the OCaml makefiles so that the standard library and the special libraries are built as shared library. I think your patch would be much more interesting if it provided an API for dynamically loading C libraries at execution time (rather than at initialization time) and if the corresponding C primitives could then be used by dynamically loaded Caml code. [...] > - there is a small memory waste (2kb) because the names of the builtins > primitives are twice im memory I don't think you need to consider builtin primitives in a special way: just consider the runtime as another shared library. > Of course, there are some points to solve. The linker should build himself > the list of needed primitives, but I was too afraid to touch the compiler. You should definitively do that. And I think it's easy. -- Jerome