Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
OCaml / F# co-development
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2010-05-03 (16:14)
From: John Whitington <john@c...>
Subject: Re: [Caml-list] Re: OCaml / F# co-development
Hi Benjamin,

On 03/05/2010 15:46, Sylvain Le Gall wrote:
> On 03-05-2010, Benjamin Pierce<>  wrote:
>> Is anybody out there developing code in the common subset of OCaml and
>> F# so that it works with both compilers / libraries?  I'd be very
>> interested in hearing about the feasibility of this arrangement...
> There was a series of blog posts by CoherentPDF on
> 1 year ago.
> Here is one of them:
> Browse their archives to have more:

The current release of CamlPDF does this, and it's about 15000 lines of 
Ocaml / F#.

You just have the occasional thing like this:

let digest =
   function s ->
     let hasher = System.Security.Cryptography.MD5.Create () in
       string_of_int_array (intarray_of_bytearray (hasher.ComputeHash 
(bytearray_of_string s)))

to account for the difference in standard libraries. And a little bit of 
messing around with the different syntax, for example writing


instead of !x.y

And you can't use labeled arguments or polymorphic variants.

But it's perfectly feasible. I converted said 15000 lines of code in a 
few days.


John Whitington
Director, Coherent Graphics Ltd