From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=AWL,HTML_MESSAGE,SPF_NEUTRAL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 1AC09BC0A for ; Thu, 21 Jun 2007 14:23:38 +0200 (CEST) Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.239]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id l5LCNb7U016266 for ; Thu, 21 Jun 2007 14:23:37 +0200 Received: by nz-out-0506.google.com with SMTP id s18so498220nze for ; Thu, 21 Jun 2007 05:23:36 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=iUIKNNm5qDk4JgqkhBXbQGo7tijstfSW0QWAy441YzOXhOarWf2FTXz65a10GgCpJuhcTilmjCaIo5a8eZntweq06WtxRRzSO93upmIDsYPFR5BemZx8Zzuj6WDlAYhAYChFpW7eL2AzAs8vRati8gvhw3XeE8c++ajcn4vtNfM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:references; b=TKVdvVnqUHE6qfONPsywj8pktJUa4dk5/9GmF89+mDgOmwXAdAmJHZQanisRLCt0FUIKg8VMfcyHvD64QeVPa/wtAtdptCKdHtHo4cngwPiYGn/+KO3FpP+r1LItnlyWzN4DVmrFfmkr2dhjhc9UoD3iVipFF4okP4vjys5Dx84= Received: by 10.114.73.1 with SMTP id v1mr1543059waa.1182428615627; Thu, 21 Jun 2007 05:23:35 -0700 (PDT) Received: by 10.115.48.7 with HTTP; Thu, 21 Jun 2007 05:23:35 -0700 (PDT) Message-ID: <9f09a07a0706210523s658056c7sf9ede3e571f27bc5@mail.gmail.com> Date: Thu, 21 Jun 2007 14:23:35 +0200 From: "Matthieu Dubuget" To: caml-list@inria.fr Subject: Re: [Caml-list] ocaml dll in an Erlang runtime In-Reply-To: <200706211300.24624.jon@ffconsultancy.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_94458_14249012.1182428615591" References: <6616D98C65DD514BA2E1DDC5F92231550228B6EB@esealmw115.eemea.ericsson.se> <9f09a07a0706210315j1fc1f675yfdadf812c995da7f@mail.gmail.com> <200706211300.24624.jon@ffconsultancy.com> X-j-chkmail-Score: MSGID : 467A6DC9.001 on concorde : j-chkmail score : X : 0/20 1 0.000 -> 1 X-Miltered: at concorde with ID 467A6DC9.001 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; matthieu:01 dubuget:01 matthieu:01 dubuget:01 ocaml:01 erlang:01 runtime:01 ocaml:01 dlls:01 callbacks:01 cmxa:01 canasse:01 dlls:01 callbacks:01 cmxa:01 ------=_Part_94458_14249012.1182428615591 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline 2007/6/21, Jon Harrop : > > On Thursday 21 June 2007 11:15:39 Matthieu Dubuget wrote: > > 2007/6/21, Joel Reymont : > > > I tried to build a shared library for use with Ruby once and failed > > > miserably. > > > > Could you please elaborate about this? Maybe not on this thread. > > > > I ask this, because almost all my OCaml code is use as shared > libraries... > > I think a lot of people (myself included) would benefit enormously if you > could explain in words of one syllable exactly how you can compile an > OCaml > program into a DLL (.so on Linux) and call it from C. Not an OCaml "program". I simply write C DLLs embedding my Caml code as described in 18.7.5 Embedding the Caml code in the C code http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc238 Nothing automatic. I manually write all C functions, have them call OCaml callbacks, etc. If this is actually what you have in mind, I can write and post one minimalistic example. It is possible to have a tool to turn one OCaml library (CMA/CMXA) into one shared library. See ODLL, from N. Canasse in the hump. Salutations Matt ------=_Part_94458_14249012.1182428615591 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline

2007/6/21, Jon Harrop <jon@ffconsultancy.com>:
On Thursday 21 June 2007 11:15:39 Matthieu Dubuget wrote:
> 2007/6/21, Joel Reymont <joelr1@gmail.com>:
> > I tried to build a shared library for use with Ruby once and failed
> > miserably.
>
> Could you please elaborate about this? Maybe not on this thread.
>
> I ask this, because almost all my OCaml code is use as shared libraries...

I think a lot of people (myself included) would benefit enormously if you
could explain in words of one syllable exactly how you can compile an OCaml
program into a DLL (.so on Linux) and call it from C.


Not an  OCaml "program". I simply write C DLLs embedding my Caml code as described in

18.7.5  Embedding the Caml code in the C code

http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html#htoc238
 
Nothing automatic. I manually write all C functions, have them call OCaml callbacks, etc.
If this is actually what you have in mind, I can write and post one minimalistic example.

It is possible to have a tool to turn one OCaml library (CMA/CMXA) into one shared library.
See ODLL, from N. Canasse in the hump.

Salutations

Matt


------=_Part_94458_14249012.1182428615591--