caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* csml: high-level bindings between OCaml and .Net
@ 2008-09-16 15:37 Alain Frisch
  2008-09-16 22:32 ` [Caml-list] " Stefano Zacchiroli
  0 siblings, 1 reply; 9+ messages in thread
From: Alain Frisch @ 2008-09-16 15:37 UTC (permalink / raw)
  To: Caml mailing list

Dear Caml developers,

LexiFi is proud to announce the first public release of CSML, a system 
to interface OCaml and .Net/C#. CSML makes it possible to leverage 
existing .Net components from OCaml, to expose OCaml libraries into the 
.Net world and more generally to write mixed OCaml/.Net applications.

With CSML, developers write scripts that describe interactions between 
the two worlds (OCaml and .Net). It is possible to bind functions, 
static or instance methods, properties, to pass opaque pointers from one 
heap to the other, or to copy values structurally. CSML preserves type 
safety properties from the two worlds, it propagates exceptions and 
first-class functions in a sound way and it deals automatically with 
memory management.

CSML is used internally by LexiFi to develop complex OCaml/C# 
applications and to expose its core technologies as .Net components.


More information, download, screenshots and documentation:

              http://www.lexifi.com/csml/


CSML is made of a compiler and a small runtime system. The runtime 
system is licensed under the LPGL with the classical linking exception. 
The compiler comes free of charge in binary form only. It is entirely 
possible to use CSML in the context of an open-source project or in a 
commercial application.

Note: CSML works with the forthcoming OCaml 3.11. To use it now, you can 
check out a recent version from OCaml'S CVS. CSML has been tested with 
the two "native" ports of OCaml for Win32 (MSVC and MinGW).


Enjoy!


Alain Frisch
LexiFi SAS


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-16 15:37 csml: high-level bindings between OCaml and .Net Alain Frisch
@ 2008-09-16 22:32 ` Stefano Zacchiroli
  2008-09-16 23:06   ` Alain Frisch
  2008-09-23 10:14   ` CSML: now under GNU/Linux + Mono Alain Frisch
  0 siblings, 2 replies; 9+ messages in thread
From: Stefano Zacchiroli @ 2008-09-16 22:32 UTC (permalink / raw)
  To: caml-list

On Tue, Sep 16, 2008 at 05:37:58PM +0200, Alain Frisch wrote:
> LexiFi is proud to announce the first public release of CSML, a system  
> to interface OCaml and .Net/C#. CSML makes it possible to leverage  
> existing .Net components from OCaml, to expose OCaml libraries into the  
> .Net world and more generally to write mixed OCaml/.Net applications.

Out of curiosity: is CSML specific to Windows or not? The available info
are ambiguous about that: your announcement does not say anything about
that, while the web page starts mentioning "the community of OCaml
developers under Windows". Can in principle CSML be used on GNU/Linux,
for example on top of Mono? (I guess at the very least a release of a
different binary-only compiler will be needed, but still ...)

Also, please note that the README linked from the website has an
important ambiguity in the licensing terms. It reads: "The compiler can
be freely used but it cannot be not redistributed without the express
permission of LexiFi SAS." (note the double negation); you probably want
to fix it.

Cheers.

-- 
Stefano Zacchiroli -*- PhD in Computer Science \ PostDoc @ Univ. Paris 7
zack@{upsilon.cc,pps.jussieu.fr,debian.org} -<>- http://upsilon.cc/zack/
I'm still an SGML person,this newfangled /\ All one has to do is hit the
XML stuff is so ... simplistic  -- Manoj \/ right keys at the right time


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  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-23 10:14   ` CSML: now under GNU/Linux + Mono Alain Frisch
  1 sibling, 1 reply; 9+ messages in thread
From: Alain Frisch @ 2008-09-16 23:06 UTC (permalink / raw)
  To: Stefano Zacchiroli; +Cc: caml-list

Stefano Zacchiroli wrote:
> Out of curiosity: is CSML specific to Windows or not?

Currently CSML only works under Windows.

I've briefly tried to make it work under Linux with Mono some months ago 
but I stopped very quickly; I could not even call a simple C function in 
a shared library from C# with Mono (see 
http://lists.ximian.com/pipermail/mono-list/2008-March/037946.html). If 
anyone is interested in helping porting CSML to Mono, please let me know!

> Also, please note that the README linked from the website has an
> important ambiguity in the licensing terms. It reads: "The compiler can
> be freely used but it cannot be not redistributed without the express
> permission of LexiFi SAS." (note the double negation); you probably want
> to fix it.

Fixed. Thanks.


Alain


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-16 23:06   ` Alain Frisch
@ 2008-09-17 11:46     ` Richard Jones
  2008-09-17 13:03       ` Alain Frisch
  2008-09-17 13:19       ` (off topic) " Richard Jones
  0 siblings, 2 replies; 9+ messages in thread
From: Richard Jones @ 2008-09-17 11:46 UTC (permalink / raw)
  To: Alain Frisch; +Cc: caml-list

On Wed, Sep 17, 2008 at 01:06:06AM +0200, Alain Frisch wrote:
> I've briefly tried to make it work under Linux with Mono some months ago 
> but I stopped very quickly; I could not even call a simple C function in 
> a shared library from C# with Mono (see 
> http://lists.ximian.com/pipermail/mono-list/2008-March/037946.html). If 
> anyone is interested in helping porting CSML to Mono, please let me know!

This didn't work?

http://www.mono-project.com/Interop_with_Native_Libraries

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-17 11:46     ` Richard Jones
@ 2008-09-17 13:03       ` Alain Frisch
  2008-09-17 16:09         ` Ludovic Coquelle
  2008-09-17 13:19       ` (off topic) " Richard Jones
  1 sibling, 1 reply; 9+ messages in thread
From: Alain Frisch @ 2008-09-17 13:03 UTC (permalink / raw)
  To: Richard Jones; +Cc: caml-list

Richard Jones wrote:
> On Wed, Sep 17, 2008 at 01:06:06AM +0200, Alain Frisch wrote:
>> I've briefly tried to make it work under Linux with Mono some months ago 
>> but I stopped very quickly; I could not even call a simple C function in 
>> a shared library from C# with Mono (see 
>> http://lists.ximian.com/pipermail/mono-list/2008-March/037946.html). If 
>> anyone is interested in helping porting CSML to Mono, please let me know!
> 
> This didn't work?
> 
> http://www.mono-project.com/Interop_with_Native_Libraries

That was indeed my main source of information for the implementation of 
P/Invoke under Mono, and I confirm it did not work.

-- Alain


^ permalink raw reply	[flat|nested] 9+ messages in thread

* (off topic) Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-17 11:46     ` Richard Jones
  2008-09-17 13:03       ` Alain Frisch
@ 2008-09-17 13:19       ` Richard Jones
  1 sibling, 0 replies; 9+ messages in thread
From: Richard Jones @ 2008-09-17 13:19 UTC (permalink / raw)
  To: Alain Frisch; +Cc: caml-list

You piqued my interest and I managed to get C# FFI to work in Mono:

https://www.redhat.com/archives/libvir-list/2008-September/msg00283.html

Rich.

-- 
Richard Jones
Red Hat


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-17 13:03       ` Alain Frisch
@ 2008-09-17 16:09         ` Ludovic Coquelle
  2008-09-19 15:45           ` Alain Frisch
  0 siblings, 1 reply; 9+ messages in thread
From: Ludovic Coquelle @ 2008-09-17 16:09 UTC (permalink / raw)
  To: Alain Frisch; +Cc: Richard Jones, caml-list

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).

Is it easier to use CSML compare to porting ocaml code to F#?


On Wed, Sep 17, 2008 at 9:03 PM, Alain Frisch <alain.frisch@lexifi.com> wrote:
> Richard Jones wrote:
>>
>> On Wed, Sep 17, 2008 at 01:06:06AM +0200, Alain Frisch wrote:
>>>
>>> I've briefly tried to make it work under Linux with Mono some months ago
>>> but I stopped very quickly; I could not even call a simple C function in a
>>> shared library from C# with Mono (see
>>> http://lists.ximian.com/pipermail/mono-list/2008-March/037946.html). If
>>> anyone is interested in helping porting CSML to Mono, please let me know!
>>
>> This didn't work?
>>
>> http://www.mono-project.com/Interop_with_Native_Libraries
>
> That was indeed my main source of information for the implementation of
> P/Invoke under Mono, and I confirm it did not work.
>
> -- Alain
>
> _______________________________________________
> Caml-list mailing list. Subscription management:
> http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
> Archives: http://caml.inria.fr
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [Caml-list] csml: high-level bindings between OCaml and .Net
  2008-09-17 16:09         ` Ludovic Coquelle
@ 2008-09-19 15:45           ` Alain Frisch
  0 siblings, 0 replies; 9+ messages in thread
From: Alain Frisch @ 2008-09-19 15:45 UTC (permalink / raw)
  To: caml-list

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



^ permalink raw reply	[flat|nested] 9+ messages in thread

* CSML: now under GNU/Linux + Mono
  2008-09-16 22:32 ` [Caml-list] " Stefano Zacchiroli
  2008-09-16 23:06   ` Alain Frisch
@ 2008-09-23 10:14   ` Alain Frisch
  1 sibling, 0 replies; 9+ messages in thread
From: Alain Frisch @ 2008-09-23 10:14 UTC (permalink / raw)
  To: caml-list

Hello all,

There is a new release of CSML that works under GNU/Linux on top of Mono 
(tested with Mono 1.2.4). Even the Windows Forms example works fine.

http://www.lexifi.com/csml/

The CSML compiler produces the same output for the Windows/.Net and the 
Linux/Mono version (there is a tiny difference for the runtime system). 
It is possible that the Linux/Mono version also works for other 
Unix-like systems, but I haven't tried.


For those interested, there is now a mailing list for CSML (links on the 
web page above). Thanks to OCamlCore and the forge.ocamlcore.org team 
for hosting it!


Alain


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2008-09-25  1:47 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-09-16 15:37 csml: high-level bindings between OCaml and .Net 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
2008-09-17 13:19       ` (off topic) " Richard Jones
2008-09-23 10:14   ` CSML: now under GNU/Linux + Mono Alain Frisch

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).