beginners

Todor Dinev 2025-04-22T12:16:43.646199Z

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!

Todor Dinev 2025-04-22T12:18:28.354919Z

Forgot to mention that WSL is not available in my environment and I cannot install applications for security reasons, either.

practicalli-johnny 2025-04-22T12:21:48.477829Z

Have you tried the MSI install for windows https://github.com/casselc/clj-msi

Todor Dinev 2025-04-22T12:22:15.579999Z

Yes, but it doesn't work due to the corporate firewall.

practicalli-johnny 2025-04-22T12:24:55.552509Z

Or if you can use the scoop package manager for windows, there is https://github.com/littleli/scoop-clojure

Todor Dinev 2025-04-22T12:27:18.204869Z

Thanks. Tried it just now but my proxy blocks it as well.

Todor Dinev 2025-04-22T12:27:44.939489Z

Is there any particular reason no standalone zip file exists? It seems to me that would be one of the easiest solutions.

practicalli-johnny 2025-04-22T12:27:46.376689Z

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

Todor Dinev 2025-04-22T12:28:31.045519Z

We could arrange to proxy clojars via our local Nexus instance. I believe that problem could be circumvented.

practicalli-johnny 2025-04-22T12:38:38.776399Z

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

Todor Dinev 2025-04-22T12:39:25.117839Z

It does.

👍 1
Bob B 2025-04-22T12:49:04.787069Z

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

Todor Dinev 2025-04-22T13:21:36.708839Z

Thanks a lot. Trying to get this to work but I am currently getting a java.net.UnknownHostException: No such host is known

2025-04-23T14:25:01.737099Z

Try with this instead: https://github.com/borkdude/deps.clj

Todor Dinev 2025-04-25T11:16:38.101149Z

Thank you!

tastyminerals 2025-04-22T17:52:53.477169Z

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.

Samuel Ludwig 2025-04-22T18:04:52.785009Z

honestly, for debugging beyond basic repl-evals, i've found #flow-storm to be plenty more than enough

2
Franco Gasperino 2025-04-22T21:23:05.433999Z

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.

1
practicalli-johnny 2025-04-22T22:38:19.943459Z

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.

👌 1
tastyminerals 2025-04-23T06:28:07.483689Z

I actually had to search for tap and portal, thanks, never heard of them. Still getting to know clojure.

❤️ 1
2025-04-22T18:53:53.793099Z

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?

2025-04-22T18:58:20.362029Z

number of routes

2025-04-22T18:58:37.904969Z

compojure is essentially a linear search

2025-04-22T19:00:03.988349Z

I wouldn't worry about it too much though

2025-04-22T19:02:45.608749Z

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

2025-04-22T19:14:54.282439Z

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)

2025-04-22T19:15:20.588869Z

(should you require those features)

2025-04-22T19:33:25.004909Z

Thanks 👍🏻

gku 2025-04-22T06:48:52.356279Z

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!

2025-04-22T07:05:32.496809Z

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

🙌 1
andrea 2025-04-22T07:10:55.983249Z

(. instance-expr (method-symbol args*)) See dot special form https://clojure.org/reference/java_interop#dot

🙌 2
gku 2025-04-22T07:53:51.557809Z

Thanks!! So I am guessing this could also be re-written as: (. clojure.lang.RT (next x))) | V (clojure.lang.RT/next x)

gku 2025-04-22T07:54:53.360169Z

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

2025-04-22T11:50:05.937299Z

yes