3 ms·
I would love to see a channel primitive similar to Golang's. They really seem to have hit the nail on the head with that one.
by Zikes 12y ago
I would love to see a channel primitive similar to Golang's. They really seem to have hit the nail on the head with that one.
- jeremiep 12y agoClojure's core.async library works wonders in ClojureScript giving you channel primitives and coroutines. I've never tried using them across web workers however.
- noelwelsh 12y agoThe CSP model is very nice, but I don't think that what this proposal is aiming for. CSP is more about concurrency, while the post makes it clear they are looking at parallelism. This is more addressing "things that appear to be single threaded but run faster" like image analysis, for instance.
- nkozyra 12y agoThey're obviously separate concepts, but tangentially related. Even in Go you'll learn that sometimes introducing multithreading to a concurrent application will actually reduce your performance due to reconciliation of context-switching within the application. Javascript already has its own inherent concurrency, obviously, but it's not outlandish to say that introducing a goroutine/coroutine concept would be a lot more elegant and manageable.
- coding4all 12y agoClojure and ClojureScript have core.async which does a great/better job https://github.com/clojure/core.async/blob/master/examples/walkthrough.clj#L89 https://github.com/clojure/core.async/blob/master/examples/w... There's also a video if you care to watch https://www.youtube.com/watch?v=enwIIGzhahw https://www.youtube.com/watch?v=enwIIGzhahw