caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Alain Frisch <alain.frisch@lexifi.com>
To: caml-list <caml-list@inria.fr>
Subject: Re: [Caml-list] csml: high-level bindings between OCaml and .Net
Date: Fri, 19 Sep 2008 17:45:20 +0200	[thread overview]
Message-ID: <48D3C910.6020501@lexifi.com> (raw)
In-Reply-To: <d6c7b34d0809170909v7a411729n6c977f49fa56b670@mail.gmail.com>

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



  reply	other threads:[~2008-09-19 15:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 15:37 Alain Frisch
2008-09-16 22:32 ` [Caml-list] " Stefano Zacchiroli
2008-09-16 23:06   ` Alain Frisch
2008-09-17 11:46     ` Richard Jones
2008-09-17 13:03       ` Alain Frisch
2008-09-17 16:09         ` Ludovic Coquelle
2008-09-19 15:45           ` Alain Frisch [this message]
2008-09-17 13:19       ` (off topic) " Richard Jones
2008-09-23 10:14   ` CSML: now under GNU/Linux + Mono Alain Frisch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48D3C910.6020501@lexifi.com \
    --to=alain.frisch@lexifi.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).