Hi, everybody,
I am using Windows through a corporate firewall at work and I was wondering why there is no standalone zip file of the Clojure CLI that you could just extract and reference in your PATH environment variable (just like with a JDK). I believe this would make it much easier to use and get acquainted with the language in more secluded environments like mine.
Thanks!
Forgot to mention that WSL is not available in my environment and I cannot install applications for security reasons, either.
Have you tried the MSI install for windows https://github.com/casselc/clj-msi
Yes, but it doesn't work due to the corporate firewall.
Or if you can use the scoop package manager for windows, there is https://github.com/littleli/scoop-clojure
Thanks. Tried it just now but my proxy blocks it as well.
Is there any particular reason no standalone zip file exists? It seems to me that would be one of the easiest solutions.
Sounds like your corporate firewall means you cant use Clojure at work in a meaningful way as I assume it blocks access to clojars, so you wouldnt be able to download lbraries. Unless you can get access to an approved mirror with Clojure libraties, I think you are out of luck
We could arrange to proxy clojars via our local Nexus instance. I believe that problem could be circumvented.
Yes, I did something similar when working for Citi Bank back in 2017. Both Clijure CLI and Leiningen will download the clojure jar files as part of its install. They both use https by default, so hopefully the local Nexus instance supports https
It does.
There sort of is: <https://github.com/clojure/brew-install/releases/tag/1.12.0.1530> has the tools zip and a PS1 script... all the ps1 script appears to do is extract the zip file somewhere on your PSModulePath. This is what scoop appears to do.
So, there is a standalone zip (it's still gonna gonna pull jars the first time through, but that should be configurable to an internal mirror ahead of time. The zip needs to be extracted to PSModulePath instead of path because it's a powershell script, not an executable/batch file.
Scoop also says that the powershell is no longer the preferred mechanism, and recommends deps.clj (<https://github.com/borkdude/deps.clj>), which has a zip file with an executable that can be extracted to someone on %PATH%.
Thanks a lot. Trying to get this to work but I am currently getting a java.net.UnknownHostException: No such host is known
Try with this instead: https://github.com/borkdude/deps.clj
Thank you!
Hello, neovim users who use https://github.com/Olical/conjure, how do you configure debugging? Looks like Conjure has the bare bones or WIP status on it. Previously, I used https://github.com/liquidz/vim-iced which comes with a very nice debugger but... the author started working on https://github.com/liquidz/elin spinoff. So, it might take a while.
honestly, for debugging beyond basic repl-evals, i've found #flow-storm to be plenty more than enough
I find debugging more a personal process than something configured. My repl-based debugging revolves more around use of tap than break+step. In that case, i apply tap in the clojure namespace where needed, then use conjure's tap viewer (<leader>vt) to view them.
Rich code blocks and Portal (wrap-portal to capture all evaluations) covers me for everything, except perhaps some overly complex recursive code. Then its time to learn a bit of flowstorm I guess. https://github.com/Olical/clojure-dap looks like a very promising project though.
I actually had to search for tap and portal, thanks, never heard of them. Still getting to know clojure.
I've read that Compojure doesn't scale as well as Reitit and that it performs worse in the "large", without large really being defined. Is this a function of traffic, number of routes, or both? What kind of numbers constitute "large"? Hundreds of requests a second? Thousands? A dozen routes? A hundred?
number of routes
compojure is essentially a linear search
I wouldn't worry about it too much though
the fact that reitit doesn't do a linear search is more an example of how useful exposing the routing information as data is (you can compile it into a fast tree search if you want), and that ability to manipulate routes as data is a better argument for reitit than the performance
I see. I was wondering because one thing I feel Compojure does "better" than Reitit is destructuring and coercion of params. There are a few hoops to jump through with Reitit to do what's basically trivial with Compojure, so I was curious if/where the tipping point is. It sounds like the tipping point is less about routing itself and more about what you can do with route information when it's just a data structure (rather than locked away in macros)
(should you require those features)
Thanks 👍🏻
Hey folks! I was reading through clojure core and trying to understand how seq and next works and I came across this:
In clojure.core/next:
(def
^{:arglists '([coll])
:tag clojure.lang.ISeq
:doc "Returns a seq of the items after the first. Calls seq on its
argument. If there are no more items, returns nil."
:added "1.0"
:static true}
next (fn ^:static next [x] (. clojure.lang.RT (next x))))
They're using the dot macro like so (. clojure.lang.RT (next x))) which I am assuming is similar to using it like so: (. clojure.lang.RT next x)) ? -or- is this a recursive call to fn next?
But in clojure.core/conj they're caling conj directly:
conj (fn ^:static conj
...
([coll x] (clojure.lang.RT/conj coll x)))
Can someone please explain how def next is implemented? Thanks!The RT means it's part of the runtime, so you'll have to dig into the Java sources for that, but it basically calls a next() method on whatever collection type it is so it's not in any singular place.
For example, here's the one for vectors: https://github.com/clojure/clojure/blob/ce55092f2b2f5481d25cff6205470c1335760ef6/src/jvm/clojure/lang/APersistentVector.java#L470
I suppose https://github.com/clojure/clojure/blob/ce55092f2b2f5481d25cff6205470c1335760ef6/src/jvm/clojure/lang/RT.java#L711 would be the entry point
(. instance-expr (method-symbol args*))
See dot special form
https://clojure.org/reference/java_interop#dot
Thanks!! So I am guessing this could also be re-written as:
(. clojure.lang.RT (next x)))
|
V
(clojure.lang.RT/next x)
static public ISeq next(Object x){
if(x instanceof ISeq)
return ((ISeq) x).next();
ISeq seq = seq(x);
if(seq == null)
return null;
return seq.next();
}
Because it's a static function in RT.javayes