[ANN] Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0

The 0.4.0 release of Diskuv OCaml for Windows users is available! It is usable enough that I’ve let my school-age kids (elementary through high school) install it and go through some tutorials.

The links to the documentation are available from the above link as well.

Here are the one-time inconveniences if you install this release:

  1. The built-in antivirus Windows Defender treats newly signed binaries like spam. There needs to be enough people who “Report this file as safe” before the binaries are trusted. If you do nothing but mark it safe or install it on Windows, you are helping others!
  2. The installer will automatically install the Visual Studio compiler if needed. But Visual Studio sometimes requires a reboot. The instructions will tell you if you need the reboot.
  3. The Visual Studio Code OCaml plugin defaults to expecting a legacy ocamlenv program on Windows. You have to search for ocamlenv in Visual Studio Code Settings and disable it. This should have a fix, but not in time for this release.

Windows parity with Unix

  1. opam commands like opam install should work without any wrappers. But
    you should create new switches with opam dkml init (see --help for options).

  2. dune commands like dune build should work without any wrappers. The only
    hiccup is that aliases like dune build @runtest need to be escaped in
    PowerShell like:

    dune build `@runtest
    
  3. You have partial support if your home directory has spaces, since it is very common on Windows to have your username be FirstName LastName. So far I’ve configured/patched most things to work with spaces, but there could be common packages that were missed, and only NTFS drives work.

  4. OCaml 4.12.1. I’d like to upgrade to 4.13 or 4.14, but having support for Visual Studio Code debugging with 4.12-only ocamlearlybird is more important, especially for traditional Windows users.

  5. Dune 2.9.3. I’ve bundled in support in 2.9.3 for fswatch/inotify so that dune build --watch works on Windows. Nothing is blocking an upgrade to 3.x except time (ie. not now) and a reason.

  6. Opam 2.1.2 plus some PRs that are pending the not-yet-released version 2.2.

  7. Git performance on Windows just sucks. It is like someone designed it for a Linux kernel :face_with_raised_eyebrow:. Apparently Git FSMonitor in 2.37.0 can be enabled to speed things up, but I don’t have real-world experience with it because it was just released yesterday.

  8. MSYS2, which can be accessed with with-dkml bash, now uses the CLANG64 variant. There are thousands of up-to-date third-party libraries available and, unlike MinGW, they are ABI compatible with the dominant Windows compiler (MSVC). And if you are interested there is an ocamlverse Help Wanted to add the CLANG64 compiler as an alternative to the Administrator-requiring, reboot-needing MSVC compiler.

Thanks to OCaml Software Foundation for sponsoring this!

0.4.x will be the last minor versions of the “preview”. I’ll be shifting to closing out any show-stopping bugs, and updating the various Windows onboarding guides for OCaml to officially include Diskuv OCaml.

Enjoy!


The full change log and upgrade instructions is available at Releases · diskuv/dkml-installer-ocaml · GitHub

14 Likes