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.
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.
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!
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.
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.
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.
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.
MSYS2 variables are available as Opam global variables. The list is here. For example, opam var --global msystem is CLANG64 and opam var --global mingw-package-prefix is mingw-w64-clang-x86_64. They will become useful when Opam depext functionality is added for MSYS2.
Fix version in Add/Remove Programs that was dev instead of 1.0.1 (etc.)