English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2006-01-04 (02:39)
From: skaller <skaller@u...>
Subject: Re: [Caml-list] PIC
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 <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net