Anyone who’s done cross-platform development on Windows knows that getting things to compile can be a huge pain in the ass. Sometimes it’s not even possible. The whole situation kinda sucked, until now.

Enter Linux on Windows

There’s this new thing called the Windows Subsystem for Linux. Without going into too much detail, WSL provides a bash shell that exposes a Linux environment. It’s native Linux, too — These are ELF binaries running inside Windows. The Windows file-system is fully accessible, with each drive having its own mount point. Linux processes can bind to the Windows loopback address and it all just works. You can read the technical details here, but the practical implications are simple enough: Windows is finally a good OS for doing cross-platform development.

A native Linux environment running inside Windows.

WSL isn’t installed by default, so you’ll need to follow these instructions to get started.

A practical example

I do a lot of Rust development in my personal time. Rust actually has excellent Windows support, however, there are packages that link against C libraries that aren’t well supported on Windows. One of my projects depends transitively on OpenSSL, for example. Trying to compile on Windows results in this:

While most of these issues can be resolved with enough persistence, it’s a huge waste of time and effort. My typical reaction is to ditch my beefy desktop and its multiple monitors for a small, relatively under-powered MacBook where things just work™. Not anymore!