Hi all, I just installed and tried out CLJ for windows and wanted to give some constructive criticism:
1. The instructions don't work as written, permission errors are not solved by running Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
as that only allows locally created scripts to run -- not those from the internet. I solved it by running Set-ExecutionPolicy Unrestricted -Scope Process
before running the install script (using a scope of Process means the settings will revert when you close the powershell window).
2. Having the clj
and clojure
commands only available from PowerShell is a fairly poor user experience imo. It means I can't run them from Cmder, git bash, cmd.exe itself, or any of the other shells on windows that I (and probably many people) actually use. I saw @seancorfield's suggestion to add a clj.cmd and clojure.cmd to the PATH which both simply run powershell clj
, which is a good idea and I think if we're really gonna stick with a PS script then this should be done as part of the install.
3. Having to use PowerShell to do the install was a bit annoying, only a miner gripe of course but still not the best UX
Iām not interested in adding python to the mix here
You'd rather maintain 2 separate tools?
The idea is that you'd replace both the bash and PS scripts with Python, so you'd be reducing the number of languages in the mix š And python is not the only option, for example there's also Node (perhaps written in cljs even), though I'm not sure you can compile Node scripts to standalone binaries. But yeah regardless, it's only a suggestion; it's just what I would do personally (and might still do for my own personal use :)).
@miridius it's very important that the installer can be run on any system with no dependencies (except the JVM). Does Windows ship with Python pre-installed?
No it does not, but you don't need it. You can build Python scripts into standalone binaries that include the Python runtime (and any other imports) so they will run with 0 dependencies
Interesting option.
Does pyinstaller create cmd files on Windows and sh for macOS and Linux?
No it makes binaries rather than scripts. So on Windows you get a .exe, on Linux it's just binary file without extension
Ah I see.
just managed to install clj on windows by:
- manually downloading the clojure-tools zip (setting permissions on the install script didnt work for me, probably because I'm not admin)
- manually creating one of the install locations. found by seeing output of $env:PSModulePath
- unzipping the tools there
- running clj
, then editing the deps.edn in my home dir to point to private repositories
yay, finally got it going! š
next step.. get cursive able to use this. Anyone have experience of clj+cursive on windows?
FWIW, I configured Cursive to point to a .bat script, which just does CALL powershell clj %*
- ie launches powershell and passes on any args. this appears to work when I run it on its own. on syncing a cursive project, cursive outputs: 'cannot execute: invalid token'.
Put Clojure-CLR, dependent DLLs and wget.exe and Clojure-CLR scripts in the same directory, which is a portable solution. CoreRT, like graalvm, can native compilation of the results of the Clojure-CLR compilation, Clojure's thing, solved with Clojure, it's a politically correct choice.:simple_smile:
I think the point is that requiring an install of python and then clj tools is just a crap first impression. If I had to install Ruby to install X, that wouldn't particularly entice me to install X.