core-async

Jakub Holý 2019-11-10T10:35:22.106800Z

https://www.jtolio.com/2016/03/go-channels-are-bad-and-you-should-feel-bad/ Interesting to read about problems with channels in Go. The Clojure implementation seems much better in this regard:) though it shares some of the challenges, such as proper cleanup vs leaking go blocks, the chance of a deadlock

1
markmarkmark 2019-11-10T15:32:46.107500Z

I feel like the simple change that core async makes around closing channels makes most of the points in that article moot

💯 1
markmarkmark 2019-11-10T15:33:27.108300Z

the reason that it's hard to write the "stop when score reaches 100" toy example in Go is because the go channel api is burdensome (as they mention later in the article)

markmarkmark 2019-11-10T15:34:19.109400Z

in core async you can just do (when (> score 100) (close! c)) and everything down the chain just reacts to sending and receiving giving them a nil return value

markmarkmark 2019-11-10T15:34:32.109800Z

but in Go, if you are sending to a channel and it closes you get a panic

markmarkmark 2019-11-10T15:34:46.110200Z

which is a huge pain to deal with in my admittedly limited experience

markmarkmark 2019-11-10T15:35:05.110800Z

and when you get from a cclosed channel in Go it returns the zero value of whateve the channel is

markmarkmark 2019-11-10T15:35:44.111700Z

so it's harder, though not impossible, to determine if the channel is closed or if all of the scores you're getting are 0.

markmarkmark 2019-11-10T15:36:30.112300Z

but, it's true that people should give the concurrency primitives outside of core async and channels a good look

markmarkmark 2019-11-10T15:36:33.112600Z

they're all good stuff