[ANN] Diskuv OCaml 1.x.x; Windows OCaml installer no longer in preview

Diskuv OCaml (DKML) has graduated to version 1.0.0. That means you’ll see DKML listed as a Windows option for OCaml on the various OCaml websites soon.

To recap … by following the simple download and install instructions for Windows you will get:

  • OCaml 4.12.1
  • dune and opam working transparently as if you were on Unix
  • a playground Opam switch so you can start coding without having to learn many Opam commands
  • your Opam switches supported by the Visual Studio OCaml plugin
  • all the prerequisites you need for OCaml programming:
    • a C compiler and assembler (Visual Studio Build Tools)
    • a UNIX environment (MSYS2; mostly you won’t see it)
    • source control (Git for Windows)
  • support! File an issue at https://github.com/diskuv/dkml-installer-ocaml/issues. I don’t promise your Windows issue will be fixed, but it will be reviewed.

Changes since 0.4.0:

  • An uninstaller. Now you can Add and Remove “Diskuv OCaml” from the Control Panel
  • The old GitLab repository at https://gitlab.com/diskuv/diskuv-ocaml is being retired. There will be a new GitLab repository with much more testing capacity that will be online in the next few months.

Full documentation is at https://diskuv.gitlab.io/diskuv-ocaml/#introduction.

Package maintainers: Have a look at the just announced setup-dkml to test your own GitHub packages using most of the Windows functionality listed above.

Thanks (again!) to the OCaml Software Foundation (OCSF) for their support of DKML. Please consider becoming a contributor to DKML to improve the Windows ecosystem. Enjoy!

14 Likes

Regarding [ANN] Windows-friendly OCaml 4.12 distribution - Diskuv OCaml 0.1.0 - #24 by bobzhang

Appreciate that you tried the installer @bobzhang !

Any chance you can also file issues; you get updates when an issue is fixed, and I doubt most new users are going to know/care to search in discuss.ocaml.org.

(I’m assuming you installed 1.0.0 rather than a preview 0.x.x version from the old now-closed thread)


  • The ocamlformat looks like you have extraneous and unnecessary quotes in the profile name. ocamlformat does work; I use it habitually several times a day. My guess is you are invoking it directly with extra quotes; a bug issue would really help here.
  • ppx_jane; I’m unfamiliar with this one, probably because there are many Jane Street packages that do not and will likely not support Windows for the foreseeable future. I’ll have a look at this when I’m back at a PC (may be awhile) for this specific package. Regardless ppx_jane is an indicator that you may be reliant on other Jane Street packages. I don’t want to speak for Jane Street, but I recall them being clear in their documentation about what only works on Unix and why (mostly they don’t have a Windows Async scheduler) and they have also said on discuss.ocaml.org that they didn’t use Windows in their testing. So three issues. 1. I really need to be more upfront that existing OCaml developers reliant on Jane Street must switch to alternatives (ex. Lwt not Async) to work on Windows. 2. Much of the very very useful Real World OCaml book promotes Jane Street libraries which will cause new Windows users to have immediate problems; I’ll see if a chat with the authors can help create a path forward. 3. The error you get is not helpful here. I think this will change in Opam 2.2 … packages that don’t work in Windows will be clearly flagged as not available in Windows. But regardless some change needs to occur; a bug issue would be helpful here.

Thanks!

1 Like

Sorry @jbeckford, OCaml is a side hobby for me and I sometimes forget what was discussed and when. My bad.

No problem. I was alluding to bug reports and things like ocamlverse (thanks!) being better long term forms of information retrieval.

1 Like

FWIW ppx_jane doesn’t have any unix dependencies and should work on Windows. We use ppx_jane along with quite a few other Janestreet libraries at work and have been using it successfully on windows with Cygwin + fdopen repositories for a while now.

Good. That means it will be easy to fix.

Curious what “quite a few other Janestreet libraries” implies. Does that mean you don’t need to be aware of the Base/Core split at the bottom of Base, and then for each Janestreet library you want to use check its transitive dependencies to see whether a library will work on Windows? Or are you relying on tribal knowledge / trial-and-error about what should work and what doesn’t?

The Base/Core split at the bottom of the Base is still relevant, though slightly outdated now that Core itself is compatible with non unix platforms. The situation is fairly simple these days in that core_unix is the library that is unix specific and base and core both work on windows, javascript etc.

and then for each Janestreet library you want to use check its transitive dependencies to see whether a library will work on Windows? Or are you relying on tribal knowledge / trial-and-error about what should work and what doesn’t?

Checking the transitive dependencies has worked well so far. If a library doesn’t use core_unix or async_unix it has worked well on windows in my experience.

1 Like

Okay that is what I thought. That doesn’t translate well for a new OCaml user. They won’t know how to do that, and even if they did they wouldn’t be able to predict which packages they would need in the future. Speaking from personal experience here … @bobzhang was rightly talking about 3 hours being a hard sell … but using Janestreet on Windows could (and did) waste weeks of time when you realize you can’t get past an Async dependency. Using Cygwin+MinGW doesn’t solve it. Incredibly frustrating and can easily become “I hate OCaml; let me post soemthing terrible on Reddit or HN”, and while I’m glad your work (which sounds like a very experienced OCaml group) only needed the subset that is compatible with Windows, that isn’t the bar for recommending a set of packages to all Windows users.

Does that make sense?


Regardless, Ppx_jane and all the PPX subset of JS packages need to be added to the Diskuv OCaml test suite and perhaps upgraded to 0.15.x; I was quite unaware of that package.

3 Likes

Diskuv OCaml 1.0.1 Release

This is mostly a bug fix. It is available at https://github.com/diskuv/dkml-installer-ocaml/releases/download/v1.0.1/setup-diskuv-ocaml-windows_x86_64-1.0.1.exe and the full release notes are at Release v1.0.1 · diskuv/dkml-installer-ocaml · GitHub

Summary of changes:

2 Likes