Fork me on GitHub
#beginners
<
2021-07-18
>
dehli02:07:23

Hi, I’ve got a question about deps.edn. I’m using the latest version of clojure (1.10.3) but when I try to use the :git/sha functionality (mentioned https://clojure.org/reference/deps_and_cli#_git) I get an outdated error message (`Library foo has missing :sha in coordinate`). Is there something else I need to do to ensure my tools.deps is updated (or is that functionality not available with my Clojure version)?

phronmophobic03:07:50

what version does it say when you run clojure --help?

phronmophobic03:07:59

I'm not an expert on the cli stuff, but I think the cli version can be different than the clojure version, https://clojure.org/releases/tools#_releases

dehli03:07:11

Version: 1.10.3.855

phronmophobic03:07:09

you can try just using :sha rather than :git/sha as a work around, https://clojurians.slack.com/archives/C6QH853H8/p1625875870182300

dehli03:07:25

Thanks! When i just use :sha i get a different error (`Error building classpath. No coordinate type found for library`). I’ll try upgrading to the alpha version and see if it has different behavior.

alexmiller04:07:52

The :git/sha stuff is only in the prereleases, not in 855

dehli04:07:03

Thanks, that explains it!

alexmiller04:07:10

In 855 you’ll need a :git/url too

alexmiller04:07:47

That’s the source of the last error

dehli12:07:53

gotcha! I was trying to play around with the derived urls that were mentioned but i’ll hold off until the next release. thanks again for the help!

Sivaram Konanki03:07:55

How can I have million light weight threads in clojure like Go can spawn million goroutines for concurrency ? Do I uses futures, async, tasks on threadpool? How can I achieve this level of concurrency

Sivaram Konanki05:07:05

Is multithreaded go async blocks achieve a lot of concurrency. ? Project loom is WIP and from what I heard it's performance is bad

Cora (she/her)05:07:00

it won't achieve the same kind of concurrency that erlang's beam vm or golang achieve, no. the tradeoffs are different. clojure's go blocks execute on a limited thread pool and only park on certain operations, not including I/O

Cora (she/her)05:07:07

> go blocks should not (either directly or indirectly) perform operations > that may block indefinitely. Doing so risks depleting the fixed pool of > go block threads, causing all go block processing to stop. This includes > core.async blocking ops (those ending in !!) and other blocking IO.

Cora (she/her)06:07:58

in the jvm this gets attacked differently. take a look at http-kit and how they manage to make 600k concurrent connections https://http-kit.github.io/600k-concurrent-connection-http-kit.html

Cora (she/her)06:07:03

a common thing I see is using async-io and then handling callbacks on thread-pools. threads are freed while the i/o is waiting when i/o is ready the handlers are dispatched to some kind of executor thread pool to complete

Ben Sless06:07:34

You should also take into account goroutines aren't "free". You can spawn a lot of them but the second they need to actually allocate things on the stack things get hairy. Their default stack size is small. They will slow down significantly one you push the runtime. Use go blocks for " async" operations, threads for CPU and blocking operations. You can pretty easily convert async functions to one which return channels

dgb2321:07:34

Project Loom sounds very cool at first glance

dgb2321:07:47

also continuations and tail call eliminations are things Clojure should very much like

lsenjov22:07:48

Pulsar (lightweight erlang-style threads/actors) might also be something to look at, but it doesn’t look like it’s been updated for a couple years

Adrian Smith20:07:35

Hey how would I replicate this call in Clojure?

OpenCVFrameConverter.ToMat converterToMat = new OpenCVFrameConverter.ToMat();

alexmiller20:07:04

(def converterToMat (OpenCVFrameConverter$ToMat.))

alexmiller20:07:41

(but note this assumes you've :imported OpenCVFrameConverter$ToMat (that needs a package, not sure what it is)

👍 3
Adrian Smith20:07:06

yep works after adding OpenCVFrameConverter$ToMat to :import like you said, thank you