I normally use Linux, and I feel very much at home with Clojure. But I’m working with people who aren’t used to environments other than Windows, and we’re trying to collaborate on software I’ve written. And I feel slightly lost. CLJ doesn’t (currently) support Windows, and without the normal command line, Emacs feels different. So I’d like to hear about other’s experience!
Do you find Clojure development limited on Windows?
Do you use a linux-like environment (Msys, Linux Subsystem for Windows [WSL], …)?
What editor do you prefer on Windows? Do you have a different preference on Windows compared to on Linux / Mac?
What build tooling do you use? Leiningen in a normal shell, or CLJ through WSL?
Do you use PowerShell / CMD, and in a custom terminal emulator (ConEMU etc.)?
Please share your thoughts!
Teodor
P.S. There have been some previous threads on Windows tooling for Clojure. I’m summarizing relevant threads I’ve found for reference. I’m asking again because there’s been some development in recent times: clj gaining traction, Calva for VS code. I’m especially curious about subjective judgement; what people prefer, and what people consider to be reasonable options.
An update on where I am with Windows for Clojure development: since December 2017, we’ve switched from Boot to clj at work, and I’ve also switched from Atom/ProtoREPL (which depended on an nREPL server) to Atom/Chlorine (which only needs a Socket REPL). Chlorine has logic in it to handle a “load file” command issued from a Windows editor being sent to a Socket REPL running on WSL (I run Ubuntu still), which was my main irritant of developing Clojure in a split Windows/WSL environment.
I’ve been using Cognitect’s REBL on my Mac but haven’t figured out a way to run that on Windows, given that clj-on-Windows is still a work in progress. That said, it looks like there’s been quite a bit of community-based testing around the PowerShell installer so that may become a viable option “soon”.
I think, at this point, if anyone is trying to do serious Clojure work on Windows, they’re probably better off staying with lein/boot and working entirely native on Windows, unless they want to switch to a full Linux-based workflow, entirely inside WSL – the file path separator issues you’ll encounter with editors/REPLs (except for Chlorine, as noted above) will be too painful to work bridged across the two environments.
Windows is 3rd class in terms of support for clj (although recently it’s been moved up to the priorities enough to allow community-driven development).
When I absolutely needed clj (which is rarity, and due to projects that focus on it), I’ve gotten by using the unofficial clj port clj-windows which is based on go and deploys as a static binary (you can grab the pre-compiled archive from releases).
Otherwise, I’m just using leiningen, with its powershell script. Lein has supported windows pretty much from the beginning. I think boot has too. I layer emacs|cider on top of that.
For restricted environments (common) where I only have the JVM, Nightcode comes with support for both lein and boot out of the box, and is a completely self-contained environment (uberjar), or if you can install it, it comes with an installer.
In all, my clojure + lein experience on windows has been great - for years. The unofficial clj distribution appears to work (for the handful of times I’ve used it). No idea when the official clj for windows is coming out (I think there’s a developer board somewhere that has more information).
[edit] Something is jacked up on this platform. I had relatively ancient posts getting flagged as spam for some unknown reason, which prevented me from posting helpful links to the clj-windows and nightcode repositories. Clojureverse stock is down in my book…
One of the options is Cygwin with Emacs/Cider(*) and lein.
I’ve also managed to run clj under Cygwin with slightly patched linux version (I spoke about this to Alex and I hope to release patch soon).
*) Cider is currently broken for mixed environments (see issue). But I also managed the workaround (see issue comment).
The PowerShell version of clj for Windows is coming along really nicely, thanks to Andrew Oberstar.
He has a repo up containing clj as a PowerShell Module and I’ve been testing it. I can run a lot of our work setup on it now, including overriding the “user” deps file via CLJ_CONFIG, using a variety of aliases and options, starting up REBL, Socket REPLs, running test suites (it surprised me several of our subprojects pass their tests on Windows, to be honest!). I’ve used it with a mix of local deps (both JARs and folders) and git deps, as well as regular Maven/Clojars deps.
Andrew and Alex are discussing the implications of using a PS Module as the mode of delivery (that’s outside my Windows knowledge!) but definite progress and very nice to use so far.
We’ve been using the #clj-on-windows room on Clojurians slack as the meeting point for working on the clj port. Would love to have feedback there on what Andrew has been doing! I’m hoping to at least get something alpha out soon for people to try.
To hit the ground running on Windows and avoid any setup whatsoever, I suggest checking out Nightcode. https://sekao.net/nightcode/
It’s a Clojure environment with a good editor, REPL, Boot and Leiningen all built in.
Just install (or run the JAR version) and you’re good to go.
Hi,
I learned Clojure on Windows using IntelliJ mostly. That was good for the basics including working through Clojure for the Brave and True. I use Linux on a day to day basis now with emacs but I had some big teething trouble on Windows especially with emacs and the lack of a good debugger that Windows.net folks are so used to in Visual Studio. Looking back there some things that were strange for Windows users like emacs using folder and file names with dots in them, emacs.d is a folder with a period not a “.d” file extension - doh) and the whole Maven repository thing that took a bit to grok (is it like nuget? Can I use the command prompt to just NuGet a jar file, dependencies and or resources? And how is it different from Clojars?). Windows web creators mostly only know IIS (OK Apache works too but you know…) and so having an idea how things are done without a web server like IIS takes a bit of getting used too, like where exactly do I put my resources or jar files, and who/how to start or stop the web server, is there no click to configure load balancing or user/cookie affinity services. Come to think of it I don’t recall it being super obvious how you would deploy a toy web app somewhere as you get further along. Anyway I feel that most Windows .net programmers (with no Java experience) need to overcome a lot before being able to be productive and comfortable with Clojure. The language is one thing but then you must give up the very well curated Visual Studio experience and workflow before you can imagine how to be productive in Clojure.
I use leiningren, emacs, and cider on windows with the openjdk. It was pretty easy to get setup. I had been using emacs a bit for my blog, so that wasn’t too hard to get going. I think there is a way to use Visual Studio Code with Clojure now.
I’m still learning and haven’t done any real deployments or anything like that, but getting the environment setup and working wasn’t too bad.
Other than that my setup is pretty straight forward. I try to use Powershell Core for my terminal which works well. Plus this whole setup is basically the same as it is on my MacBook when I work on that.