Hi! I’m up for a new work laptop, and not being impressed by Apple’s most recent hardware I am considering making the switch from OSX to Windows (I have my eye on a Surface Book 2).
I haven’t used Windows for development in a while, and I thought I’d find out if other Clojurists have opinions about it first.
For the most part my workflow involves JVM Clojure, usually from inside IntelliJ, but I also occasionally need to use shadow-cljs and other cljs stuff, and we’re experimenting with tools.deps. Beyond that a lot of my work involves docker containers.
Anyways, I’d love to hear from people who have made the same switch (or otherwise have general impressions of Windows-based Clojure development). Thanks!
[EDIT: I’m particularly interested in how useful the new Linux Subsystem stuff works in Windows, especially if I have JVM processes that needs to talk to stuff running in docker images, like my datomic transactor. From reading online, I get the impression that it’s a little painful interoperating with non-subsystem stuff.]
I have been developing clojure on Windows for 8 years now.
The entire development environment on the U disk:
jdk
lein (clojure, clojurescript, luminus webapp)
clojureclr (Nuget, .net winform app)
postgresql
R
notepad++
conemu (or cmder)
If you’re on the latest Windows 10 update, WSL is really solid. I run Leiningen, Boot, and the new clj stuff in WSL with no problems. My experiences so far with host interop have been very smooth: Microsoft’s approach to WSL means that both Windows and WSL see the same set of services, networks, disks, etc. I’ve had no problems with Clojure code on WSL accessing MySQL running natively on Windows, for example.
A good friend of mine has blogged about all aspects of his switch back to development on Windows: https://marcesher.com/
I’m the author of shadow-cljs and I migrated to Windows in January myself for the same reason. I can report that shadow-cljs works fine. Cursive/IntelliJ works flawlessly and way better than on my MacBook which frequently tried to lift off with fans at max. I’m on a really beefy machine now though, so not sure how a Surface Book performs.
At first I tried running all dev stuff via WSL which works ok but the filesystem performance is pretty bad still and is quite noticeable in many areas, e.g. running yarn add package can take 60sec+ whereas running it directly from a windows cmd prompt in the same directory takes about 15sec.
WSL otherwise works fine and didn’t have any compatibility problems so far. Networking works fine and I had no issues accessing VirtualBox machines.
I made desktop shortcuts to start lein repl for my Clojure projects so I don’t have to use cmd.exe to get it running, which is actually way more convenient than opening a terminal, changing to the directory and typing lein repl every time. Never dug into PowerShell yet, cmd.exe is only slighty usable with clink otherwise unusable.
tools.deps support for Windows is still missing but works fine in WSL.
I made the mistake of buying Windows 10 Home and can’t run Docker since thats needs the Pro variant. Didn’t feel like upgrading yet.
I’m only a Clojure hobbyist at this point, but I use Windows (10) as well. I do like having WSL, but I’m a huge fan of PowerShell (to the point of setting it as my login shell on my CentOS box).
As for Clojure development, literally the only issue I have is not being able to use “clj” from PowerShell. It works fine from WSL, but I look forward to getting the native Windows support.
As for Docker, just make sure you get Windows 10 Pro, so you can turn on Hyper-V.
About half our team at work is on Windows and it’s mostly fine using Clojure tooling. The biggest problem I’ve run into are differences with docker.
Originally we had dockerized all of our packages, but running shadow-cljs inside of a docker container was a huge source of pain. We wanted hot reloading to work, which meant finicking with drive sharing & firewall rules on our corporate laptops. Also, file system events did not propagate into the container, which meant that I had to ask @thheller to add a polling option (which he so kindly did!).
Overall it was a huge pain in the ass, so I currently suggest that devs run shadow-cljs outside of the container and only build once you want to make sure it will run in the prod environment.
Thanks for the replies everyone. Based on the above I ordered a Windows laptop, and now it’s all your fault!
So far things are going… ok. The WSL stuff is a lot more of a work in progress than I expected it to be, but it seems promising. Once I can figure out how to share my git authentication credentials between WSL bash, IntelliJ, and whatever “git for windows bash” is, I’ll be off and running.
There is a Powershell implementation in progress. You can see it in the repo (last time I checked, anyway) but I don’t know what bugs/blockers there are in it.