This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2022-07-07
Channels
- # aleph (10)
- # announcements (6)
- # architecture (23)
- # atom-editor (2)
- # beginners (35)
- # biff (5)
- # cljdoc (22)
- # clojure (14)
- # clojure-europe (18)
- # clojure-hungary (2)
- # clojure-nl (6)
- # clojure-uk (6)
- # clojurescript (39)
- # core-async (1)
- # data-science (14)
- # datascript (20)
- # datomic (4)
- # graalvm (18)
- # jobs-discuss (5)
- # keechma (1)
- # leiningen (4)
- # malli (3)
- # nbb (11)
- # nextjournal (2)
- # off-topic (1)
- # parinfer (1)
- # releases (1)
- # remote-jobs (3)
- # shadow-cljs (7)
- # sql (2)
- # xtdb (4)
Can somebody explain me the meaning of "direct and transitive calls" in core.async/>!!
direct = you invoke a function transitive = functions that you invoke, invoke a function
so in context, that means inside a go block you should not call >!! or a function that calls >!!
if you do, it can block, and there are a small finite set of go block threads - if you block enough of them, go blocks stop working
How can I run the core.logic constraints on an external database( Neo4j etc) using pldb ? Kind of querying. The database is huge and I don't want to pull the whole DB.
Have a question about ex. 3 from here https://aphyr.com/posts/306-clojure-from-the-ground-up-state
From the ex. 4 it seems like it is somehow possible to calculate those futures in parallel using reduce
(in contrast to using atom
). But I can't understand how we can do it. Something like this obviously does not work:
(def v [(future (sum 0 (/ 1e8 2))) (future (sum (/ 1e8 2) 1e8))])
(reduce + v)
Can somebody please point me in the right direction?Oh, now I got it.
I was doing something like (+ @(future …) @(future …))
and wondering why it seemed like a consecutive execution with no improvement in time. Now I understand that I need to start futures simultaneously, e.g. [(future …) (future …)]
, and when I refer to them later they will already be executing in parallel.
Thanks for clarification!
According to Programming Clojure, 2nd Edition, What if you want to coordinate an update of both current-track and current-composer with an atom? The short answer is “You can’t.” That is the difference between refs and atoms. If you need coordinated access, use a ref. But this seems to work with any problem, what am I missing from that explanation?
(def current-track (atom "Venus, the Bringer of Peace") )
; #'user/current-track
(def current-composer (atom "Creedence Clearwater Revival") )
; #'user/current-composer
(dosync
(reset! current-track "Ramble tamble") (reset! current-composer "CCR"))
; "CCR"
@current-composer
; "CCR"
@current-track
; "Ramble tamble"
The reset! and @ there are not part of the transaction
that is, the dosync is doing nothing there
and a concurrent modification in a different thread could change things in between the reset! and @
np... you should check out the 3rd edition of that book ;)
I actually have a physical copy of the 3rd edition 😊 and a digital of the 2nd, I’ll be sure to check this part specifically. Maybe it also explains why is it ok (transaction-wise) to group several ref-set inside a dosync, but it’s not nice to run several reset!
I'm going through brave clojure and the https://www.braveclojure.com/basic-emacs/ points me towards http://github.com/flyingmachine/emacs-for-clojure/ which reads
WARNING this does not work currently.
A lot has changed since I last put significant effort into this repo, and as a result this emacs config is broken.
I hope to get it working again soon (as of 2022-04-02)
I was wondering if anybody has a safe/up-to-date reference for setting up emacs for clojure.I think https://prelude.emacsredux.com/en/latest/modules/clojure/ is well-maintained and there's a #prelude channel (as well as an #emacs channel).
I can't recommend any setup guides as it's been many years since I used Emacs but back when I did use it, Prelude was what I settled on after many other attempts to get a good dev env up and running on Emacs 🙂
(I switched to Atom and then VS Code, in case you're wondering, mostly for their ability to render arbitrary HTML UIs and therefore support visualization tooling)
In general, for beginners coming to Clojure, I recommend using whatever editor/IDE you're already comfortable with if it supports Clojure.
According to https://clojure.org/news/2022/06/02/state-of-clojure-2022#_working_with_clojure Emacs usage has decreased from 50% four years ago to about 40% now, IntelliJ/Cursive has held steady at 30% and VS Code has climbed from 10% to around 20%.
100% agree on both counts. Prelude emacs is actually written by the author/maintainer of CIDER. A great way to go. But there is no need to learn Emacs just for Clojure. If it sounds great (I love it) go for it but Cursive has a free community version for IntelliJ and VS Code has Calva which is free and open source.
we’re happy to help beginners get setup. We might direct you to other channels to get more specific help but “I’m a beginner and I have a question” is perfect for #beginners
(ie, don’t read “ask in #emacs ” as saying you shouldn’t have asked here. just that they can help more)
If emacs isn't a good idea these days, by no means will I force using it, but I've been using it here and there for almost a year and brave clojure had me thinking it would be a very nice experience to pair it with clojure. I also have VS Code with Calva (which works just fine honestly) and Cursive (my first impression wasn't too great but I'm willing to blame myself). I'll ask my original question in #emacs and then get something set up to get a little taste.
@U11BV7MTK Might you know what "The lein executable isn't on your 'exec path'" means? I have cider installed and it returns that message whenever I cider-jack-in
.
sure. so just like your command line has a list of places to look for executables (the PATH variable) so does emacs. Usually the easiest way to fix this is https://github.com/purcell/exec-path-from-shell which attempts to copy your system’s path into emacs exec-path
and there’s a #cider channel and of course #emacs for all of your questions you might have about that