clj-on-windows

pez 2024-07-03T16:02:55.354799Z

I know it is often suggested that people use WSL2. But it is making the path to running Clojure in your editor very much longer. It can be: 1. Install Java 2. Install clojure (the clojure.exe one) 3. Install a Clojure plugin in your favorite editor 4. BOOM! With WSL2 it becomes: 1. Figure out what WSL even is 2. Figure out what the difference between WSL and WSL2 is (I don’t think I have figured this out, failing to configure things to use WSL2, and wondering if maybe that is what is being used already) 3. Figure out how to install it a. Figure out if you have a new enough Windows version for it 4. Figure out how to get Linux in there 5. Figure out how to make Windows to allow virtualization 6. Figure out how to enable your machine allow virtualization 7. Steps I haven’t discovered yet, because I am stuck on 6, because I don’t have physical access to the Windows machine. 8. Install Java in WSL 9. Install clojure in WSL 10. Install a CLojure plugin in your favorite editor 11. BOOM? I think it’s fine to discover that you need WSL for whatever reason, but would be nice if you have a chance to fall in love with Clojure first.

borkdude 2024-07-03T16:04:43.597209Z

https://github.com/casselc/clj-msi BOOM

pez 2024-07-03T16:08:36.425959Z

Yeah! Step 2 in the non-WSL option. 😃

thheller 2024-07-03T16:11:53.029049Z

FWIW WSL has its uses because its linux, not because you can run clojure in it. I don't run clojure in WSL most of the time.

➕ 2
pez 2024-07-03T16:14:20.360249Z

I think a problem with finding the WSL option promoted when interested in Clojure is that you choose it even though you would have gotten away fine without it. I know I am a bit like that if I get the impression that some option is more cooler. Such sidetracks can loose someone like me a lot of time!

pez 2024-07-03T16:16:26.994579Z

If I had to work on Windows (beyond the countless hours trying to get Calva jack-in to work there) I would for sure use WSL as much as I could.

seancorfield 2024-07-03T16:54:13.873219Z

I suggest WSL for long-term Clojure usage because pretty much all the books and tutorials -- and nearly all project READMEs -- assume a *nix-like O/S and provide commands that work on those environments and often fail on Powershell/CMD due to weird quoting issues (and MS has recently changed how quoting works on PS making life even harder for people navigating all that material). For folks new to WSL, installation is a lot easier now than it used to be (open Powershell as Administrator, run wsl --install) although I can't verify that since I don't have a clean Windows machine to try it on. Then you go to the MS Store and "Get" Ubuntu. Maybe you also want to "Get" MS Windows Terminal as a better shell? For folks who just want to "try" Clojure without necessarily going further down that path, sure, install Java, install Calva in VS Code and you're good to go. Install the Clojure CLI via clj-msi if you want/need (that still isn't easy enough to discover -- it isn't even mentioned on https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows )

seancorfield 2024-07-03T17:01:21.383579Z

This page links to the clj-msi installer for Windows (non-WSL) users: https://clojure-doc.org/articles/tutorials/getting_started_cli/ It very deliberately does not advocate WSL and it mostly points to other resources rather than try to duplicate them (and now I see that the official installer recommends the version-free POSIX/Linux install script, so I need to take that duplication out).

seancorfield 2024-07-03T17:02:40.250879Z

(the official installation guide has a Java section that recommends the temurin openjdk)

Alex Miller (Clojure team) 2024-07-03T17:21:54.942319Z

I've been talking with Rich and I'm planning to overhaul some of the getting started and recommendations as part of 1.12. it is likely that we will also kill off the powershell impl in favor of the other alternatives (but not final yet)

❤️ 2
pez 2024-07-03T18:35:47.839419Z

If we’re introducing someone who has install Clojure on their todo list because they’re going to work with it, it makes a ton of sense to advice about WSL. But it’s different for people who have learn a new language on their todo list and think Clojure’s value prop looks interesting. As little accidental complexity as possible makes more sense then. > installation is a lot easier now than it used to be I’m glad I tried now then and not what used to be. 😃 It was my own attempt two days ago I described above. And I haven’t got it working yet. > MS has recently changed how quoting works on PS Tell me about it! It is driving me nuts. I’m almost considering disabling Jack-in on Windows. Only almost, though.

seancorfield 2024-07-03T19:25:49.980509Z

@pez Someone else just ran into this and I directed them to the #calva channel.

phronmophobic 2024-07-03T20:24:23.920509Z

I'm a complete Windows noob and I've previously gotten WSL2 clojure up and running. However, my main use case was to try running swing applications, which doesn't work under WSL2 so I recently retried setting up clojure in powershell. Overall, it went fairly smoothly.

pez 2024-07-03T20:25:37.253149Z

@seancorfield Let’s hope I’ve fixed it now. I really have no more ideas.

seancorfield 2024-07-03T20:40:44.618879Z

@smith.adriane Bit surprised Swing apps don't work -- I use all sorts of GUI-apps on WSL2 and they run fine (popping up a Linux-y UI in Windows is jarring but it works).

phronmophobic 2024-07-03T20:41:44.023059Z

It's also quite likely I was just doing something wrong.

2024-07-06T17:28:39.879039Z

Git on windows is also pretty rough. That's one reason I always go with WSL. That said, I think Clojure on windows shouldn't just be about development. It should also be about deployment. So if I want to ship an app to a Windows server or to run by users who are on windows.