This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-01-22
Channels
- # aatree (21)
- # announcements (10)
- # avi (1)
- # aws (15)
- # beginners (96)
- # boot (269)
- # braid-chat (92)
- # cider (9)
- # clara (10)
- # cljs-dev (3)
- # cljsjs (14)
- # cljsrn (20)
- # clojure (198)
- # clojure-art (3)
- # clojure-hamburg (2)
- # clojure-ireland (4)
- # clojure-russia (117)
- # clojure-spain (3)
- # clojured (1)
- # clojurescript (253)
- # code-reviews (6)
- # community-development (7)
- # conf-proposals (52)
- # core-async (4)
- # cursive (4)
- # datomic (4)
- # devcards (1)
- # emacs (59)
- # euroclojure (5)
- # funcool (1)
- # hoplon (39)
- # human (1)
- # jobs (4)
- # ldnclj (15)
- # ldnproclodo (1)
- # leiningen (3)
- # mount (37)
- # off-topic (14)
- # om (77)
- # perun (10)
- # proton (12)
- # rdf (1)
- # re-frame (9)
- # reagent (42)
- # ring-swagger (10)
- # yada (50)
@chadhs: I like it OK, but it has an oldish version of Clojure so some of the fun new stuff that makes quality-of-life upgrades doesn't work
Do people still use Refs or do people reach for core.async as the default now?
i.e. would you build an app architecture on Refs when you have core.async available
@jonschoning: If you need a Ref, use a Ref. If you need core.async, use core.async. I don’t see them as related at all.
well, i mean presumably one could use Refs and dosync
to communiate state around an app, or use core.async w/ channels instead to do the same
core.async is for asynchronous data communication between cooperating processes in your application. Ref is for managing multiple pieces of mutable state in a synchronized way.
@jonschoning: imo core.async is a bit harder to reason about, but more powerful + better for complex problems
I guess in my view, "managing mutable state" seems similar to "asynchronous data communication between cooperating processes "
especially if the "managing mutable state" is occuring on different threads
@jaredly: yeah, that makes sense
A core.async-based app may have mutable state or it may not have mutable state. A Ref-based app most definitely has mutable state. I would use those two things for very different purposes.
@chadhs: re: diff — are you sure? Works fine for me.
apiserver.core=> (diff #{1 2 3} #{})
[#{1 3 2} nil nil]
@seancorfield: ok, I can see breaking it down like that provides the most clarity
FWIW, we have ~10k lines of production Clojure with just 30 atoms and no refs. Most of those atoms are caches (mostly with TTL, via core.cache).
We also have two or three agents (mostly used for logging and email sending).
We were using core.async in one app — with Sente so we could send data back and forth over WebSockets easily — but we decided to discontinue work on that app and do things a different way.
@seancorfield: ah ok... that makes sense. Just trying to get a feel if the Clojure community had really deprecated atoms/refs; this appears to not be the case at all; all the better.
I think the use cases (between STM and core.async) are so different that they are purely complementary techniques.
@seancorfield: I totally get where you're coming from and your clarifying point earlier made a good distinction. But at the same time, I don't think it's a stretch to say one could take a concurrent app that uses atoms/refs to communicate state between processes/threads, and rewrite it to use core.async instead. this would change some of the semantics, of course, but it would be serving the same goal from an application perspective
One could say that channels are for coordinating work; atoms are for shared state
Can I get some help understanding why the following working clojurescript throws when run in a clojure REPL? (I don’t understand why ‘rps’ is still an unbound variable in the 2nd snippet.) Thanks! https://gist.github.com/sdtsui/4026a4df7f4e08cff78c
@dantsui: You are using ==
which is only for comparing nums for equality. In ClojureScript it might work, but you are hopefully seeing WARNING: cljs.core/==, all arguments must be numbers
@mfikes: Ah, thank you. (not getting that error message, but ) I think the error on line 18 of my gist makes sense (trying to cast the String on say, line 5, to a Number) Checking it out..
@eggsyntax: yeah i jumped the gun, i was doing something to the nil that was returned that was causing my error
ah… i can just coerce the resulting nil to be a set if it isn’t nil making a set a set is a noop so that works just dandy
@clojuregeek: Thanks for that site!
@mudphone: (first (filter pred coll))
is very close to the English “first item in a coll that passes a predicate”
If you defined (def ffilter (comp first filter))
, then that would be shorter but then you’d have the problem that ffilter
is not well known—hrm.
are there any podcasts/videos you'd recommend watching while I do other things? just clojureTV on youtube?
I've got a couple... http://blog.cognitect.com/cognicast/ http://www.infoq.com/Clojure/presentations/ https://vimeo.com/tag:clojure https://www.youtube.com/watch?v=9A9qsaZZefw&list=PLAC43CFB134E85266 https://www.youtube.com/channel/UCs_tLP3AiwYKwdUHpltJPuA https://www.youtube.com/watch?v=V6DKjEbdYos https://www.youtube.com/watch?v=LtW-Ge77PTw https://www.youtube.com/watch?v=wASCH_gPnDw https://www.youtube.com/user/Misophistful/videos https://www.youtube.com/channel/UCj7q1yKjZXaRcFJ-Lr-YJhA https://www.youtube.com/channel/UCLxWPHbkxjR-G-y6CVoEHOw https://tbaldridge.pivotshare.com/ https://github.com/matthiasn/talk-transcripts https://www.youtube.com/channel/UC-WICcSW1k3HsScuXxDrp0w https://www.youtube.com/user/emacsrocks
@shaun-mahood: wow, thanks
although a user named emacsrocks is going to make me feel bad since I'm the lone person using Clojure and vim 😛
Also http://www.purelyfunctional.tv/ if you want to spend money
Also, the emacsrocks channel has parens of the dead on it
with Fireplace and some other stuff, I thought it worked well enough. Never found a sane way to make vim work with ClojureScript though really. Just FWIW
I'm liking Cursive, but I'm still going to check out Emacs - IntelliJ is project-crazy.
@shaun-mahood: how are the LispCast core.async and clojure.test tutorials?
@gerred: Not sure, I still have to get around to watching them.
Have you tried core.async at all? Timothy Baldridge has a bunch of episodes on his site as well ( https://tbaldridge.pivotshare.com/ ) and he was heavily involved in the development of core.async
The original paper is pretty interesting too, it's one of approximately 2 actual computer science papers I've read through completely
I haven't yet, making the transition from Erlang / Haskell, so I'm very excited to check it out.
This is actually more the format I was looking for, rather than larger-scale classes. Quick bit then move on.
@tbaldridge: @shaun-mahood is up in here bringing you sales. 😉
Oh nice. The only other computer science thing that I read was Joe Armstrong's thesis 😉
Yeah they actually were both super interesting. Haven't used anything from either of them though!
I'm historically a vim user, but Cursive has blown me away, minus the fact that it's so focused as an IDE when sometimes I just want my code and a repl.
Cursive is really amazing. Can you map your vim shortcuts over? I'm pretty useless in both Emacs and Vim, so it's been amazingly nice for me.
understandable. One thing is, it is quite large. Take all of two big edditors and cram them together….
with a little time, I was able to squint, use vim bindings and forget it wasn’t vim though, but have nice REPL integration
I don't like wading through dialog boxes to configure stuff, and I couldn't figure out how to get it to be even close to my vim setup
yeah, configuring it is a bit of a tall order. Just wanted to provide one data point of someone that did the vim->emacs thing and liked it by using spacemacs.
I wanted to/tried to do spacemacs but just gave myself a headache 😞 good data point, I may not be smart enough to figure out how to use it well enough
hah, no, I hope that’s not the take away . FWIW, I had to put vim down a month before coming back to it. spacemacs was the same way. Weird, unapproachable and frustrating. If you think it’s worth trying, give it some time and ease into it
@gerred: I pretty much have what is essentially a scratch project open in Cursive all the time now and it sort of solves the project issue for me.