caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: David Allsopp <dra-news@metastack.com>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] Thoughts on targeting windows
Date: Sun, 5 Oct 2014 23:14:52 +0100	[thread overview]
Message-ID: <A12DB78A-2604-4E64-B0FE-64EF6590A120@recoil.org> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9E8F9A897@Remus.metastack.local>

On 9 Jun 2014, at 16:23, David Allsopp <dra-news@metastack.com> 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 
>> target windows (as well as linux & mac) and we got the 
>> impression that this would be complicated -- we gathered 
>> that neither jane street's Core nor OPAM are windows compatible. 
> 
> It's more complicated than Linux (& Mac), but not overly so.
> 
>> Would still recommend using OCaml? Are there workarounds, or 
>> other libraries that would replace Core?
> 
> I believe Core_kernel aims to be the platform-neutral parts of core? There 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 biggest problem in third party libs is in build systems (becoming less so with Oasis, OCamlbuild and so on) making naïve decisions about Windows but that doesn't usually take much patching.
> 
> Most of what I do is Windows-oriented, but some of what I've done is Windows 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 working on Windows or perhaps that one of your developers is always working on Windows or something... that should avoid accidentally selecting a Unix-only library and only realising that a painfully long way down the road (or that the library you thought was cross-platform contains an assert false for the function you need when running on Windows!). If you write something which works on Windows in OCaml it will probably translate with little pain to Linux but the reverse isn't necessarily true. 

At a recent compiler hacking session in Cambridge, Don Syme pointed out a great 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 Windows, except that they unfortunately overwrite each other's status flags (the green tick or red cross against each commit), so they cannot be simultaneously used on one GitHub repository right now.  I contacted GitHub support and they indicated that they are adding support for multiple CI tools into the 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 improve OPAM's Appveyor scripts in this regard (for MinGW or Cygwin or ideally testing them both) would be welcome. 

best,
Anil

  parent reply	other threads:[~2014-10-05 22:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-09  8:56 William
2014-06-09  9:13 ` Virgile Prevosto
2014-06-09  9:16 ` John Whitington
2014-06-09 12:06   ` Yotam Barnoy
2014-06-09 12:26     ` Matthieu Dubuget
2014-06-09 15:23 ` David Allsopp
2014-06-09 18:59   ` Yaron Minsky
2014-06-09 19:34     ` Sebastien Mondet
2014-06-09 20:06       ` Yaron Minsky
2014-06-10  9:53         ` Thomas Gazagnaire
2014-10-05 22:14   ` Anil Madhavapeddy [this message]
2014-10-09  9:33     ` Jeremy Yallop
2014-12-10  9:57       ` Anil Madhavapeddy

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=A12DB78A-2604-4E64-B0FE-64EF6590A120@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.com \
    /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).