[Blog] Using OCaml on windows with WSL

When I got started in OCaml, my setup was basically a dual boot of Windows 11 and Ubuntu. I had a few issues setting up OCaml on windows at the time and started looking up WSL and if it was a good alternative (I really disliked having to dual boot always). So I wrote this article detailing exactly how I setup OCaml on WSL and have been using it for the past 12 months with no issues. So if you are looking to get started with programming in OCaml on windows, this article is for you.
How to setup OCaml on Windows with WSL

Note:
opam 2.2 makes it a breeze using OCaml on windows natively so if you are particularly interested about using OCaml without WSL you should check it out.

8 Likes

I have a somewhat related blog post How to update or install a new Linux distribution on WSL.

1 Like

@lukstafi It’s a very detailed article. Very nice coverage.

@PizieDust Sounds like a nice and accurate update for ocaml.org. And I’m not sure if @lukstafi meant this, but a custom WSL2 distribution (a glorified tarball of docker export) based on Debian/Ubuntu (the distro that seem to be the best supported on WSL2) with OCaml + LSP + VS Code and all the Platform tools would be nice especially for a common case of people who intend to deploy to Linux (web services, etc.).

1 Like

@jbeckford Indeed this will be a great idea. Platforms like Digital Ocean that have one-click app installs will easily be able to have one click setups as well for OCaml projects with such a distribution/tarball.

1 Like