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 concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id 3F165BB94 for ; Tue, 4 Oct 2005 14:47:41 +0200 (CEST) Received: from smtp2.mathworks.com (smtp2.mathworks.com [144.212.95.218]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j94CldFE010274 for ; Tue, 4 Oct 2005 14:47:40 +0200 Received: from mail-vif.mathworks.com (fred-ce0.mathworks.com [144.212.95.18]) by smtp2.mathworks.com (8.12.11/8.12.11) with ESMTP id j94CldD1018637 for ; Tue, 4 Oct 2005 08:47:39 -0400 (EDT) Received: from MESSAGE-AH.ad.mathworks.com (ex-01-ah.mathworks.com [144.212.95.156]) by mail-vif.mathworks.com (8.11.7/8.11.7) with ESMTP id j94Clcv25454 for ; Tue, 4 Oct 2005 08:47:38 -0400 (EDT) X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Subject: RE: [Caml-list] Dynamic linking Date: Tue, 4 Oct 2005 08:47:37 -0400 Message-ID: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [Caml-list] Dynamic linking Thread-Index: AcXI0uISlBWhOp/9RoGwbWtmXd8B7AADVLrQ From: "Alexander Bottema" To: X-Miltered: at concorde with ID 434279EB.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 ocaml:01 dlls:01 ocaml:01 caml-list:01 dlls:01 statically:01 runtime:01 frog:98 wrote:01 binaries:01 supported:01 native:02 caml:02 organized: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 As a developer of the MathWorks we are shipping a product containing C/C++ code, Java code, Fortran, etc. The infrastructure that drives everything is written in C++ and we're talking about a code base that has been developed for more than 20 years. Every module that is based on top of the core is written as a DLL and that's the way everything is organized. Changing this infrastructure would be a task that would not be reasonable by any means. It would cost the company a tremendous amount of money and there would be no clear benefits from it. Actually, I like the way it is being organized where every "leaf" product is just a DLL. Now, as a developer it would be nice if it was possible to write certain parts in OCaml. The foreign language interface is good enough to be used in conjunction with C/C++, but the lack of support to use it in DLLs makes it impossible for us to have any OCaml code in our leaf product. Nevertheless, I really tried to make it work (and I almost did). It's only Linux/AMD64 that I couldn't solve and I really tried to modify the AMD64 emitter. -- Alexander Bottema The MathWorks -----Original Message----- From: Jon Harrop [mailto:jon@ffconsultancy.com]=20 Sent: Tuesday, October 04, 2005 6:57 AM To: Alexander Bottema Subject: Re: [Caml-list] Dynamic linking On Wednesday 28 September 2005 13:44, you wrote: > I managed to get dynamic linking for OCaml (i.e. making OCaml producing > DLLs that could then be used by other native code/binaries) to work on > almost all our supported platforms (Linux x86, Windows (2000/XP), > Solaris 2, Mac OS X). > The only platform which I couldn't get to work was Linux AMD64. I tried > to modify the OCaml emitter for AMD64 to accommodate position > independent code using the offset tables, but it was too hard. If anyone > picks up this task, please let us know. As it stands today we cannot use > OCaml for production code. May I ask what other approaches you have tried? In particular, why not=20 statically link in the OCaml code? I'd have thought it would then be a case of either calling everything else=20 from OCaml, or initialising the OCaml runtime and calling OCaml from=20 "everything else". --=20 Dr Jon D Harrop, Flying Frog Consultancy Ltd. Objective CAML for Scientists http://www.ffconsultancy.com/products/ocaml_for_scientists