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 C7CA4BBBB for ; Sat, 4 Mar 2006 14:37:58 +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 k24Dbwtb013966 for ; Sat, 4 Mar 2006 14:37:58 +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 OAA03485 for ; Sat, 4 Mar 2006 14:37:57 +0100 (MET) Received: from smtp11.wanadoo.fr (smtp11.wanadoo.fr [193.252.22.31]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id k24DbvnO013963 for ; Sat, 4 Mar 2006 14:37:57 +0100 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf1102.wanadoo.fr (SMTP Server) with ESMTP id 5D06C1C000B1 for ; Sat, 4 Mar 2006 14:37:57 +0100 (CET) Received: from morgana (ARennes-257-1-7-9.w81-250.abo.wanadoo.fr [81.250.226.9]) by mwinf1102.wanadoo.fr (SMTP Server) with ESMTP id 281E91C000A6 for ; Sat, 4 Mar 2006 14:37:57 +0100 (CET) X-ME-UUID: 20060304133757164.281E91C000A6@mwinf1102.wanadoo.fr Received: from david by morgana with local (Exim 4.50) id 1FFWxs-0001UO-TB for caml-list@inria.fr; Sat, 04 Mar 2006 14:38:32 +0100 To: caml-list@inria.fr Subject: Looking for pointers regarding integration of OCaml plugins into OCaml native code From: David MENTRE Organization: none Date: Sat, 04 Mar 2006 14:38:32 +0100 Message-ID: <87ek1icotj.fsf@linux-france.org> User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Miltered: at nez-perce with ID 44099836.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 44099835.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; pointers:01 ocaml:01 ocaml:01 caml-list:01 bytecode:01 bytecode:01 dynlink:01 pointer:01 asmdynlink:01 pointer:01 pointers:01 fde:98 dynamically:01 thread:02 thread:02 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 Hello, I would like to extend an OCaml native code application with plugins written in OCaml (preferably native code). So, much like the C/OCaml interface, I would like to have some dynamically loaded OCaml code calling my application core code and vice versa. >>From my readings of the caml-list archives, I understand that: 1/ It is possible to load bytecode code into a bytecode application, using the Dynlink module; 2/ It could be possible to load native code into a native code application[1] but Xavier thinks this is no longer possible or too difficult[2]. I haven't be able to find the explanation Xavier is refering to. Has anybody a pointer to it? I would like to understand the issue(s). 3/ With original OCaml, it is not possible to load a bytecode into a native code application but that might be possible with the Asmdynlink module of Fabrice Le Fessant[2]. If I remember correctly (can't remember where I read that), the main issue is that native and bytecode have not exactly the same memory representation (thus, for example, the GC is different). Is that correct? Beside the missing pointer in 2/, has anybody some pointers on the issues involved? Best whishes, david Footnotes: [1] Feature 3 in: http://groups.google.com/group/fa.caml/browse_frm/thread/2827ec9d553e7760/392f26ba4316e957?tvc=1&q=xavier+leroy+dynamic+load#392f26ba4316e957 [2] http://groups.google.com/group/fa.caml/browse_frm/thread/941afd4bad6fde92/865f61b89ec57b7a?q=xavier+leroy+dynamic+native+code&rnum=1#865f61b89ec57b7a -- pub 1024D/A3AD7A2A 2004-10-03 David MENTRE 5996 CC46 4612 9CA4 3562 D7AC 6C67 9E96 A3AD 7A2A