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=0.0 required=5.0 tests=none autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id 4C8F4BBAF for ; Fri, 19 Sep 2008 17:45:30 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhMDAGpm00jAXQIniGdsb2JhbACTKwEBAQ8gnwCGXoFl X-IronPort-AV: E=Sophos;i="4.32,431,1217800800"; d="scan'208";a="17512457" Received: from concorde.inria.fr ([192.93.2.39]) by mail1-smtp-roc.national.inria.fr with ESMTP; 19 Sep 2008 17:45:30 +0200 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by concorde.inria.fr (8.13.6/8.13.6) with ESMTP id m8JFjTEj003759 (version=TLSv1/SSLv3 cipher=RC4-SHA bits=128 verify=OK) for ; Fri, 19 Sep 2008 17:45:29 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AqsEAFdm00jB/BYfX2dsb2JhbACTIRcFBgYSBZ57hl6BZQ X-IronPort-AV: E=Sophos;i="4.32,431,1217800800"; d="scan'208";a="17143143" Received: from smtp20.orange.fr ([193.252.22.31]) by mail3-smtp-sop.national.inria.fr with ESMTP; 19 Sep 2008 17:45:29 +0200 Received: from me-wanadoo.net (localhost [127.0.0.1]) by mwinf2024.orange.fr (SMTP Server) with ESMTP id A4AD41C00096 for ; Fri, 19 Sep 2008 17:45:28 +0200 (CEST) Received: from [127.0.0.1] (APuteaux-154-1-100-17.w86-205.abo.wanadoo.fr [86.205.27.17]) by mwinf2024.orange.fr (SMTP Server) with ESMTP id 3EFA91C00095 for ; Fri, 19 Sep 2008 17:45:28 +0200 (CEST) X-ME-UUID: 20080919154528258.3EFA91C00095@mwinf2024.orange.fr Message-ID: <48D3C910.6020501@lexifi.com> Date: Fri, 19 Sep 2008 17:45:20 +0200 From: Alain Frisch User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: caml-list Subject: Re: [Caml-list] csml: high-level bindings between OCaml and .Net References: <48CFD2D6.9030700@lexifi.com> <20080916223241.GA17058@usha.takhisis.invalid> <48D03BDE.6000802@lexifi.com> <20080917114605.GA7599@annexia.org> <48D1002C.5040404@lexifi.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 080918-0, 18/09/2008), Outbound message X-Antivirus-Status: Clean X-Miltered: at concorde with ID 48D3C919.000 by Joe's j-chkmail (http://j-chkmail . ensmp . fr)! X-Spam: no; 0.00; frisch:01 frisch:01 lexifi:01 high-level:01 bindings:01 ocaml:01 intensively:01 ocaml:01 rewriting:01 redistribute:01 compiler:01 lexifi:01 recursive:01 recursions:01 invoke:01 Ludovic Coquelle wrote: > Probably something went wrong somewhere ... I did use PInvoke > intensively on mono and I never experienced problem (I do not remember > which version of mono, it was around 2 years ago). I have absolutely no doubt that P/Invoke does work under Mono. I'm just saying that I could not make it work in the limited amount of time I gave to this experiment (the error I got is described in the message to the Mono mailing-list I was referring to). > Is it easier to use CSML compare to porting ocaml code to F#? It depends on how much of .Net you plan to use (and other factors). If you talk about porting OCaml code to F#, it probably means you have an existing code base that does not require .Net at all now and you want to use some features from .Net; in that case, to answer your question, using CSML is probably easier than rewriting your whole code base. F# and OCaml+CSML are really two different things. With F#, you live in the .Net world entirely: a single GC, no issues with threads, and the binding between F# and C# is automatic. CSML make the two worlds live happily together but they are still two separate worlds. For situations were both would be appropriate, there are several arguments to consider. - As far as I know, F# is significantly slower than OCaml in native code for symbolic computation (which is precisely the kind of code you would like to use ML for). - F# and OCaml are really two different languages, with their own features (e.g. the object and module systems are very different) and tools. - For people who want to support cross-platform applications, OCaml is probably a better option. CSML lets you write the parts of your applications that are specific to .Net but the rest of your project remains platform-independent. - For members of the OCaml consortium at least, being able to modify, embed and redistribute the OCaml compiler is a big plus. (E.g. at LexiFi, we rely heavily on substantial extensions to the OCaml system.) - With CSML, it is possible to have mutually recursive OCaml and C# data structures and to have a single application that calls back and forth between the two languages. As far as I know, it is not possible to link F# and C# code in the same .Net assembly, so some kind of recursions are more difficult. This is not a problem if you only want to import existing .Net libraries or to expose your ML code as .Net components, but for a mixed application, this might be an issue. Alain