clj-on-windows

neumann 2023-08-01T21:37:07.829229Z

Hi all! I just found this channel from the https://github.com/clojure/tools.deps.alpha/wiki/clj-on-Windows page linked to from http://clojure.org. I'm happy to find it! As some of you know, I'm researching barriers to getting started with Clojure. Several of the folks I've interviewed so far mentioned that running Clojure on Windows was an obstacle for them. Personally, I use a VM on Windows, so I figured it was time I tried out Windows support myself! As I run into things, I'll mention them here, if that's OK.

littleli 2023-08-02T09:05:04.233009Z

@didibus the problem with wsl2 argument is following: user wanted banana, and we delivered babana, and gorilla... and the whole jungle.

2023-08-02T17:26:37.749899Z

Ya, but that's just the development reality of Windows. Microsoft even knows it, so invested in bringing the whole jungle to it.

2023-08-02T17:29:35.864179Z

You can try just getting the banana, above works well using deps.clj. but you'll probably want a few more things, like git, emacs, a better shell, etc. Those things will each be another headache to get working correctly on Windows.

borkdude 2023-08-02T17:30:57.192169Z

git and emacs work just fine for me on windows, even clojure-lsp worked out of the box to my surprise

borkdude 2023-08-02T17:31:13.916889Z

shell is a pain though

neumann 2023-08-02T17:44:13.285029Z

Prior to WSL2, I would always use Git Bash. That worked well for me, but I haven’t tried it recently.

littleli 2023-08-02T18:12:46.478239Z

@didibus it looks the same from the opposite direction though. Windows devs scratch their forefaces when they have to deal with bash on unices. It's just a matter of perspective and experience.

2023-08-02T22:19:26.005969Z

You mean, trying to build a Windows WPF app on a Mac or Linux computer? Cause I'm not talking about the differences in workflows, like PowerShell vs SH abd windows tools vs Unix tools, or registry based config vs file, etc. I mean specifically to Clojure development, a lot of things are never tested on Windows, or don't spend as much time, and make Unix like assumptions. Maybe something shells to curl for example, or is literally implemented as a sh script, etc. Or it assumed a Unix directly structure, or environment variables, etc.

2023-08-02T22:20:26.766219Z

And my experience is that, apart from Microsoft owned development tools and languages, most other open source dev tools, languages, runtime and all treat Windows like that as well.

neumann 2023-08-01T21:37:58.277359Z

@alexmiller First issue I found is that the "clj on Windows" page has a link to the "TDEPS jira", but it's broken.

borkdude 2023-08-01T21:41:34.248129Z

@neumann Note that there is a powershell installer for clojure, but this approach has a few downsides. E.g. it's hard to shell out to "clojure" from Clojure/Java without invoking powershell as well, it only works from the powershell shell basically, unless you define some wrapper .bat file. There is an alternative installer called clj-msi which wraps deps.clj, a native binary, which is a port of the clojure bash/powershell script to clojure itself and compiled as a single binary (among other targets, but this is what clj-msi uses). https://github.com/casselc/clj-msi https://github.com/borkdude/deps.clj Another way to get deps.clj installed as clj / clojure on Windows is via #scoop clojure: there it's called clj-deps. https://github.com/littleli/scoop-clojure You can find conversations about clj-msi in the history of this channel

neumann 2023-08-01T21:42:47.444469Z

@borkdude Fantastic info! Thank you!

seancorfield 2023-08-01T22:18:48.305829Z

@neumann In case you need it, the JIRA TDEPS link should be https://clojure.atlassian.net/browse/TDEPS

neumann 2023-08-01T22:26:10.420939Z

@seancorfield Thanks!

neumann 2023-08-01T22:34:43.684629Z

Is it possible for me to submit a PR for that wiki page? I would be happy to fix all the links, but I'm not sure if that's the right process or how to do it for a GitHub wiki.

seancorfield 2023-08-01T23:26:35.156469Z

There's no PR process for it. Alex would have to give you direct edit permissions (he had to restrict all the wikis due to spammers). I was a bit surprised I didn't have edit permissions -- I went straight to it to fix it but...

Alex Miller (Clojure team) 2023-08-01T23:53:38.569409Z

I would rather spend the time rerouting the official instructions to the msi etc

neumann 2023-08-02T00:07:18.495989Z

No rush or pressure from me. Sorry there isn't an easy way for me to take it off your plate!

2023-08-02T04:25:34.158209Z

Because it's unofficial, it's burried at the very bottom in alternatives, but where it says: > There is also a Clojure based launcher compiled with GraalVM as a native executable which works with cmd.exe as well as powershell -- see https://github.com/borkdude/deps.clj to get started with it, or just run the following from PowerShell: PowerShell -Command "iwr -useb https://raw.githubusercontent.com/borkdude/deps.clj/master/install.ps1 | iex" and you're ready to type deps at cmd.exe or the powershell prompt to use it. Remark how it's called deps and not clj or clojure, that means it is safe to try this one out on top of the default PowerShell based clj on windows command. > That's the best way in my experience to get a smooth Clojure on windows. Otherwise, WSL2 is the best way, but it's more involved.

2023-08-02T04:30:00.323109Z

But the reason WSL2 is best, is because even if you get Clojure working, everything else will be a struggle as well, tooling, IDEs, even Java