From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id EE078BC28 for ; Sun, 21 Nov 2004 21:30:05 +0100 (CET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iALKU5dr002003 for ; Sun, 21 Nov 2004 21:30:05 +0100 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 VAA13456 for ; Sun, 21 Nov 2004 21:30:05 +0100 (MET) Received: from smtp1.adl2.internode.on.net (smtp1.adl2.internode.on.net [203.16.214.181]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iALKU2b2001977 for ; Sun, 21 Nov 2004 21:30:04 +0100 Received: from [192.168.1.200] (ppp217-171.lns1.syd3.internode.on.net [203.122.217.171]) by smtp1.adl2.internode.on.net (8.12.9/8.12.9) with ESMTP id iALKTp4Y037951; Mon, 22 Nov 2004 06:59:57 +1030 (CST) Subject: Re: [Caml-list] Native executable symtable From: skaller Reply-To: skaller@users.sourceforge.net To: Richard Jones Cc: caml-list In-Reply-To: <20041121155909.GA18549@annexia.org> References: <41935E30.3020104@yahoo.it> <20041111160949.GA13998@annexia.org> <419F664F.9020905@yahoo.it> <419F8664.8010501@baretta.com> <419F92C0.4010200@barettadeit.com> <20041121155909.GA18549@annexia.org> Content-Type: text/plain Message-Id: <1101068990.22082.60.camel@pelican.wigram> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 (1.2.2-4) Date: 22 Nov 2004 07:29:51 +1100 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 41A0FACD.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 41A0FACA.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 symtable:01 sourceforge:01 wrote:01 dynlink:01 bytecode:01 ocaml:01 ocaml:01 recompiled:01 hacked:01 bytecode:01 garbage:01 rewriting:01 boehm:01 garbage:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: On Mon, 2004-11-22 at 02:59, Richard Jones wrote: > It'd be very useful for mod_caml - mod_caml uses Dynlink to load the > "scripts" and handlers, and hence is limited to bytecode. Native code > dynamic linking would come in useful. I'd rather it was part of core > OCaml, or available as a separate library which didn't require OCaml > itself to be recompiled. You'll never convince a third party web site supplier to install a hacked version of Ocaml. It took ages to get Python server side available. However consider also a second problem with mod_caml: unloading. That's also essential for a long running process, and can't be done, even in the bytecode interpreter. There were *also* patches made for that (mods to the garbage collector to allow code to be collected). Finally, compare with Python where a superior implementation called 'Stackless Python' which used continuation passing was available for years. It inspired addition of a collector and generators to be added to CPython, but because it would require rewriting all the C extensions to obtain stackless operations, the mods to the core interpreter never made it into the main distribution. My point is that if *you* were on the Ocaml team you'd likely have a different perspective -- if you were going to add a feature you'd want to be fairly sure the idea was sound, complete, compatible, worthwhile -- and engineerable. I recently asked Hasn Boehm about unloading shared libraries in C and C++ code and how that would operate with a garbage collector.. he didn't see much hope of it ever working. The fact is the changes needed to ISO C/C++ to even make a *conservative* collector safe are non-trivial. Felix actually *does* collect shared libraries, but it isn't safe unless you limit data exchange very carefully to ensure there can't be any dangling pointers, since the collector can't know about C pointers -- to C strings, C functions, C++ vtables, and perhaps RTTI and exception handling stuff.. So all of this seems quite difficult .. something about the American saying "It works in practice" and the Frenchman saying "Ah yes, but does it work in theory?" -- John Skaller, mailto:skaller@users.sf.net voice: 061-2-9660-0850, snail: PO BOX 401 Glebe NSW 2037 Australia Checkout the Felix programming language http://felix.sf.net