Fork me on GitHub
#clj-on-windows
<
2024-07-03
>
pez16:07:55

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.

pez16:07:36

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

thheller16:07:53

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.

1
pez16:07:20

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!

pez16:07:26

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.

seancorfield16:07:13

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 )

seancorfield17:07:21

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).

seancorfield17:07:40

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

Alex Miller (Clojure team)17:07:54

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
pez18:07:47

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.

seancorfield19:07:49

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

phronmophobic20:07:23

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.

pez20:07:37

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

seancorfield20:07:44

@U7RJTCH6J 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).

phronmophobic20:07:44

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

didibus17:07:39

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.