What is the reasoning behind making the clj/clojure tool a PowerShell script instead of just a native application? It does not look like it does much so it should not be that much work to write it in C and that would integrate very much better with the system.
Did you not want to have to compile the program before providing it to users?
We've been having a bit of a debate on the subject recently =)
in the meantime, here is a tool that alleviates the poweshell induced troubles :
Also sean advocates biting the bullet and launch your process with powershell, then maybe connect to it "remotely" from your editor
so far people have suggested that we rewrite it in python, ruby, javascript, bat, c, etc. it was written in powershell b/c that was a pretty close port from the original in bash, and there are a lot of benefits from maintaining two similar things.
@alexmiller you're aware of the troubles we're all having with it though ?
yes
i think that the language really does not matter
but creating a path that can be sustainably maintained is a critical dimension in the decision matrix
afaik, no one has actually spent the time to write down the issues, or the dimensions on which to compare things, or the options
without that, we just have a bag of ideas, not a means to make decisions
i think they did !
where?
there is a jira thing about the quoting issues
that's one thing
then there is tooling not being able to call into powershell, and you ahve it all
the language really does matter, because ultimately, I'm the one that is going to be maintaining feature parity across these versions over time
you did the powershell script ?
some of it, yes, with help from others
here is my thoughts on that, powershell is really a wrapper for .net, all the services for powershell are available in .net, and .net is available on every windows computer
so any .net executable would allow for self-contained, always working solution
there is a plethora of languages to chose from there
even a clojrue !
one of the ideas of how clj is written is that there is essentially a clojure program to compute classpaths, and then it launches the clojure program you want to run. caching is used to avoid the first step if possible.
so, a key part of this idea is avoiding the first jvm launch if possible
right we're trying to avoid the "clojrue startup is slow" induced by lein
I don't know the tradeoffs (from a perf pov) in writing the actual tool itself in different languages
I do know that powershell seemed to be approximately similar to the use of bash in the *nix version of the tool
any startup time lost by starting .net would also be lost starting a powershell
I don't have any intuition about the truth of that assertion
but true enough, a c# solution wouldn't look anything like a bash script
well a commandlet (what the clj and clojure commands are) are .net programs
or classes really
here's what I need to move things forward:
1) a list of current issues (these could be tickets, could be other things)
2) a table with implementation options
3) and dimensions along which to compare those implementations
4) cells in the table that evaluate each option on that dimension
For example, one option is powershell, another might be an implementation in C#
dimensions would be things like building, installation, maintenance, performance/ability to avoid the jvm startup, etc
I don't have time to make that table, nor the windows developer experience to adequately perform the evaluation
I'll take a copy of your requirements and get back to you during the next week
I'm open to this being a thing maintained primarily by the community too (although I think there are a lot of good reasons for us to build and release it)
makes sense that cognitect keeps the helm of course
@carkh, for completeness, an option for the matrix would be stick with bash and have windows users use Git Bash.
@lee while i think that works and is perfectly fine, that's not self-contained
you have to think, newbie programmer deciding to try clojure being ready to go in 5 minutes
agreed, but if you are building a matrix of options, good to include rationales of rejected options.
indeed
yes, please include
newbie programmer trying clojure is one dimension
professional clojure programmer is another
they may not need the same answer
just as an aside, we go through this process of making tables of options and dimensions for pretty much every decision we do in Clojure (or Datomic)
On my mind because I just fleshed out Git Bash support for cljs compiler scripts - it was not difficult
nothing has yet been rejected - the whole point of this is to give us a tool to make decisions
@alexmiller good process if not so hot on the velocity side of things =)
I have not found charging in the wrong direction to be good for velocity
true enough
a little up front thinking saves lots of time
good point!
@carkh, another option which should be included is reimplement launcher in scripting language of each supported shell: bash (including Git Bash), Command, PowerShell
It’s nice to have an active Windows developer looking at this!
i'll add the option, though i think command batch processing is pretty bad at that
though back in the days, full featured installers were made with .bat files =)
probably right but worth including to weigh against other options and test assumptions
oh god, slack prevents me from editing my messages, and all the typos are left for everyone to see !
I’m excellent at typos!
I think your edit went through
pfiuh, i feel better now, thanks =)
@lee with your git bash option, you're using the unix shell script ?
yep
did it work out of the box ?
included with https://gitforwindows.org/
i mean, the clojure shell script
Ah.. that I have not tried. My work was on cljs compiler scripts which were written without git bash in mind.
Really only minor tweaks were required.
ok
that's so out of my realm...
sorry, just trying to give you and idea of changes necessary to get bash scripts working under Git Bash… it wasn’t overwhelming, it mostly just came down to converting java classpath to windows path syntax
hey no worries ! interesting stuff
tools.deps uses the platform-aware calls inside the jdk when generating the classpath to use, but depending on your env under git bash, not sure what you'll get
the classpath to run tools.deps itself contains only the uberjar, so there are no separators used