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 mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by yquem.inria.fr (Postfix) with ESMTP id C7065BBAF for ; Mon, 3 May 2010 18:14:54 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Al0CAJ6T3kvD2MUqnGdsb2JhbACdIhUBAQEBAQgLCAkRIrx/gm0Igh0E X-IronPort-AV: E=Sophos;i="4.52,320,1270418400"; d="scan'208";a="58505638" Received: from bluelynx4.ukhost4u.com ([195.216.197.42]) by mail1-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 May 2010 18:14:54 +0200 Received: from [78.105.203.81] (helo=muscat.lan) by bluelynx4.ukhost4u.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1O8yIF-00068U-7k; Mon, 03 May 2010 17:14:52 +0100 Message-ID: <4BDEF674.1010302@coherentgraphics.co.uk> Date: Mon, 03 May 2010 17:14:44 +0100 From: John Whitington User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.1.9) Gecko/20100317 Thunderbird/3.0.4 MIME-Version: 1.0 To: Sylvain Le Gall Cc: caml-list@inria.fr Subject: Re: [Caml-list] Re: OCaml / F# co-development References: <38561110-779B-46C3-9015-E8E43E0C9E1C@cis.upenn.edu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - bluelynx4.ukhost4u.com X-AntiAbuse: Original Domain - inria.fr X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - coherentgraphics.co.uk X-Source: X-Source-Args: X-Source-Dir: X-Spam: no; 0.00; ocaml:01 bcpierce:01 subset:01 ocaml:01 syntax:01 variants:01 cheers:01 46,:98 blog:98 blog:98 polymorphic:01 wrote:01 wrote:01 compilers:01 upenn:01 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 > http://planet.ocamlcore.org 1 year ago. > > Here is one of them: > http://coherentpdf.com/blog/?p=10 > > Browse their archives to have more: > http://www.coherentpdf.com/news-archive.html The current release of CamlPDF does this, and it's about 15000 lines of Ocaml / F#. http://www.coherentpdf.com/ocaml-libraries.html You just have the occasional thing like this: let digest = (*IF-OCAML*) Digest.string (*ENDIF-OCAML*) (*i*)(*F# function s -> let hasher = System.Security.Cryptography.MD5.Create () in string_of_int_array (intarray_of_bytearray (hasher.ComputeHash (bytearray_of_string s))) F#*)(*i*) to account for the difference in standard libraries. And a little bit of messing around with the different syntax, for example writing (!x).y 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. Cheers, -- John Whitington Director, Coherent Graphics Ltd http://www.coherentpdf.com/