From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id EC495BB9C for ; Wed, 4 Jan 2006 03:39:06 +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 k042d6LQ004242 for ; Wed, 4 Jan 2006 03:39:06 +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 DAA19948 for ; Wed, 4 Jan 2006 03:39:05 +0100 (MET) Received: from smtp3.adl2.internode.on.net (smtp3.adl2.internode.on.net [203.16.214.203]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k042d3XZ004237 for ; Wed, 4 Jan 2006 03:39:04 +0100 Received: from rosella (ppp33-4.lns1.syd6.internode.on.net [59.167.33.4]) by smtp3.adl2.internode.on.net (8.12.9/8.12.6) with ESMTP id k042cqx4091713; Wed, 4 Jan 2006 13:08:53 +1030 (CST) (envelope-from skaller@users.sourceforge.net) Subject: Re: [Caml-list] PIC From: skaller To: Nathaniel Gray Cc: Ker Lutyn , caml-list@inria.fr In-Reply-To: References: <43B6F8AF.6010807@linspire.com> <20060101104905.36934.qmail@web34614.mail.mud.yahoo.com> Content-Type: text/plain Date: Wed, 04 Jan 2006 13:38:52 +1100 Message-Id: <1136342332.17213.96.camel@rosella> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Miltered: at nez-perce with ID 43BB354A.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 43BB3547.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 -fpic:01 dlopen:01 casts:01 bytecode:01 wrote:01 sourceforge:01 functions:01 native:02 library:03 library:03 shared:04 long:05 tue:06 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Tue, 2006-01-03 at 15:27 -0800, Nathaniel Gray wrote: > Who wants to write an app without plugins these days? Who is willing to write applications that are unsound? Once Ocaml generates -fPIC it can be linked with a C wrapper to make a shared library, and your mainline (or another wrapped library) can embed a function that loads such libraries with dlopen() and retrieves a record of functions, then casts it to the expected type .. voila, you have native code plugins. Note even bytecode cannot *unload* plugins .. which is needed to execute user scripts in web pages with long running server side scripting support. -- John Skaller Felix, successor to C++: http://felix.sf.net