JS concurrency is crap. It should be shot and buried in a lead coffin. Debugging async code is pure hell. With Go, you have a normal debugger that can be used to step over the code. You can get normal stack traces for all threads if needed. There is a race detector that can catch most of unsynchronized object access. With JS? You're on your fucking own. You can't find out the overall state of the system ("the list of…
It's also unintuitive in the sense that if you are racing you usually want to discard/stop the other Promises that didn't finish in time. But the only real way to do this is to pass through an AbortController down into whatever networking/IO task (and your own code for that matter) is happening to "cancel" it that way. Otherwise you just end up with the result of the fastest Promise and the rest will continue when th…
Go Concurrency vs. RxJS
31–40 of 57 posts
Re: Go Concurrency vs. RxJS
#32Earlier quoted context omitted.
I argue CSP is far superior to async/await in almost all cases. In Go errors are explicit and always right there. No weird control flow like you see in javascript.
CSP and async/await are perpendicular concepts. In fact you can have all combinations of them. Personally though I prefer either the actor model or structured concurrency to CSP, depending on the usecase.
I've been trying to convince the gleam folks of that without too much success so far...
Re: Go Concurrency vs. RxJS
#33Re: Go Concurrency vs. RxJS
#34Re: Go Concurrency vs. RxJS
#35Re: Go Concurrency vs. RxJS
#36I always found RxJS fairly awkward. I assumed it was a skill issue (and I still think it is), but gradually learned it for personal and professional projects. It's fine. I avoid it now. I think Go is orders of magnitude better in terms of general concurrency tooling, though I know some people straight up hate it. I've recently started using Effect, the TypeScript library, and I find it's so much better than RxJS as w…
Still, the easiness RxJS is pretty cool, and if you are an expert at it, you could build complicated applications with very little code. Also Marble Testing is a cool way of testing certain application behaviors.
Overall, I would recommend searching decent alternatives. Since RxJS is too hard to get right.
Re: Go Concurrency vs. RxJS
#37Earlier quoted context omitted.
data, ok := If ok is false, the channel is closed and data is a zero value.
Whenever I used channels in Go, I regretted it at the end. Always have to look up "what happens when I do x and the channel is closed" kind of stuff. Code becomes weird with all the selects and shit. I like sync primitives and good old collections.
It gets overly verbose because of "simplicity"
Re: Go Concurrency vs. RxJS
#38Re: Go Concurrency vs. RxJS
#39Earlier quoted context omitted.
data, ok := If ok is false, the channel is closed and data is a zero value.
Whenever I used channels in Go, I regretted it at the end. Always have to look up "what happens when I do x and the channel is closed" kind of stuff. Code becomes weird with all the selects and shit. I like sync primitives and good old collections.