From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by sympa.inria.fr (Postfix) with ESMTPS id 25C3C7F02D for ; Mon, 6 Oct 2014 00:15:07 +0200 (CEST) Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=pra; client-ip=5.153.225.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of anil@recoil.org) identity=mailfrom; client-ip=5.153.225.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="anil@recoil.org"; x-conformance=sidf_compatible Received-SPF: None (mail2-smtp-roc.national.inria.fr: no sender authenticity information available from domain of postmaster@bark.recoil.org) identity=helo; client-ip=5.153.225.51; receiver=mail2-smtp-roc.national.inria.fr; envelope-from="anil@recoil.org"; x-sender="postmaster@bark.recoil.org"; x-conformance=sidf_compatible X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgsFAD7CMVQFmeEz/2dsb2JhbABfgw5TWMwOh00CBnkWAXuEAwEBAQMBeQULCw4KLkkBDQYTGogcDAm/EgETBIpJhRQ1Mwcugn+BHgWWMIF1TIRNgS2GMYojg3+DZGsBAYJIAQEB X-IPAS-Result: AgsFAD7CMVQFmeEz/2dsb2JhbABfgw5TWMwOh00CBnkWAXuEAwEBAQMBeQULCw4KLkkBDQYTGogcDAm/EgETBIpJhRQ1Mwcugn+BHgWWMIF1TIRNgS2GMYojg3+DZGsBAYJIAQEB X-IronPort-AV: E=Sophos;i="5.04,660,1406584800"; d="scan'208";a="99495445" Received: from bark.recoil.org ([5.153.225.51]) by mail2-smtp-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 06 Oct 2014 00:15:04 +0200 Received: from [192.168.1.113] (cpc7-cmbg14-2-0-cust238.5-4.cable.virginm.net [86.30.244.239]); by bark.recoil.org (OpenSMTPD) with ESMTPSA id 2b99245f; TLS version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO; Sun, 5 Oct 2014 23:16:52 +0100 (BST) Content-Type: text/plain; charset=iso-8859-1 Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) From: Anil Madhavapeddy In-Reply-To: Date: Sun, 5 Oct 2014 23:14:52 +0100 Cc: "caml-list@inria.fr" Content-Transfer-Encoding: quoted-printable Message-Id: References: To: David Allsopp X-Mailer: Apple Mail (2.1878.6) Subject: Re: [Caml-list] Thoughts on targeting windows On 9 Jun 2014, at 16:23, David Allsopp wrote: > William wrote: >> we are considering using OCaml for a rather large project, >> the bulk of which will be networking and encryption. OCaml >> seems to meet our needs with one exception: we'd like to=20 >> target windows (as well as linux & mac) and we got the=20 >> impression that this would be complicated -- we gathered=20 >> that neither jane street's Core nor OPAM are windows compatible.=20 >=20 > It's more complicated than Linux (& Mac), but not overly so. >=20 >> Would still recommend using OCaml? Are there workarounds, or=20 >> other libraries that would replace Core? >=20 > I believe Core_kernel aims to be the platform-neutral parts of core? Ther= e are other Jane Street libs which compile just fine on Windows. Batteries,= as others have noted, works out of the box. Usually, I find that the bigge= st problem in third party libs is in build systems (becoming less so with O= asis, OCamlbuild and so on) making na=EFve decisions about Windows but that= doesn't usually take much patching. >=20 > Most of what I do is Windows-oriented, but some of what I've done is Wind= ows and Linux. My experience is that it's important to keep Windows in the = picture early on to avoid pain later - so ensure that daily builds are work= ing on Windows or perhaps that one of your developers is always working on = Windows or something... that should avoid accidentally selecting a Unix-onl= y library and only realising that a painfully long way down the road (or th= at the library you thought was cross-platform contains an assert false for = the function you need when running on Windows!). If you write something whi= ch works on Windows in OCaml it will probably translate with little pain to= Linux but the reverse isn't necessarily true.=20 At a recent compiler hacking session in Cambridge, Don Syme pointed out a g= reat Travis-like service for running regular Windows builds called Appveyor= (.com). In order to get more familiar with the Windows toolchain, I ported= some of Thomas Braibant's instructions for compiling OPAM on Windows using= it here: Cygwin scripts: https://github.com/ocaml/opam/blob/master/appveyor.yml Build output: https://ci.appveyor.com/project/avsm/opam/build/1.0.38 Appveyor can be used much like Travis and build every Git checkin on Window= s, except that they unfortunately overwrite each other's status flags (the = green tick or red cross against each commit), so they cannot be simultaneou= sly used on one GitHub repository right now. I contacted GitHub support an= d they indicated that they are adding support for multiple CI tools into th= e UI, but do not have a time estimate for when that would be ready. In the meanwhile though, I hope Appveyor comes in useful for anyone wanting= to automate Windows testing via a free hosted service. Pull requests to i= mprove OPAM's Appveyor scripts in this regard (for MinGW or Cygwin or ideal= ly testing them both) would be welcome.=20 best, Anil=