The state of OCaml and Windows

As a premise, I’m not interested in Windows and OCaml in that OS. I’m only asking because I have a long standing PR on GitHub asking me to port ocaml-lua under Windows and Esy.

What is the state of the OCaml ecosystem in that context?

I’m currently fighting hard to compile the Lua library as a DLL (this works, sort of…) and linking the DLL artifact to my library using dune.

Meanwhile I realized that many libraries cannot be installed altogether: Lwt is installable using OPAM but Core/Async is not.

So the first question is: do the PR request makes sense, in the first place? Is Windows a usable environment for OCaml programmers?

Second: do I have any chance to reliably compile my stubs and link those with a DLL produced via dune as described in Foreign build sandboxing?

I apologize for the tone of the message: I wrote like that because of the frustration I’m feeling.

Maybe I developed a real allergy to Windows over the last 20 years :sweat_smile:

To be honest, if I were in your position I would probably say that I just don’t have the resources to develop for Windows but Windows development help and maintenance would be greatly welcome :slight_smile:

1 Like

Some people say it works, but with my experience it’s terrible compared to UNIX support in OCaml, or, Rust or Haskell support of the Windows platform. See the previous discussions on that topic:

And many others… While there is a work in progress to improve the platform support, it’s still hardly usable, IMHO.

1 Like

Windows Subsystem for Linux(wsl) is fit for me in daily work. The common libraries work for me. The toolchains like merlin installed in wsl are supported in VS Code in windows.
But it seems not helpful for your DLL problems…

1 Like

I started from OCaml for Windows which install a Cygwin based env and (if I well understand from the links above) it’s not a “native” Windows setup.

Maybe I’ll start over installing node + Esy and so on.

Thanks to you all.

To install Esy (a package manager) I just installed node, which contains npm, a package manager I don’t like. So to install yarn I need choco (a package manager), also optionally installed by the node installer.

Hopefully I’ll end up with OPAM. A package manager.

I need to know: at what inception level I’m risking a permanent cerebral damage? :thinking:

Yarn is mostly backwards-compatible with npm. So if you already have npm you don’t need yarn (unless the project is using some specific features like workspaces).

Once these issues solved and corresponding PRs are merged, it should be easier to build the core packages in OCaml without the need of the shell, I think:

To be clear - I am not a fan of neither Cygwin, nor WSL/WSL2. I believe, the dependence on make/shell/autotools should be eliminated eventually, otherwise Windows users will always prefer to write F# instead.