Go's model doesn't give you as much control over which thread a particular operation gets assigned to. It's not theoretically impossible, I suppose, but it's hard to imagine what a simple API for it would look like.
But yes, if this particular problem were solved in an elegant way, I would also prefer the CSP model. It makes it so you don't have to worry about which operations are async or not.
In any case I suppose many styles of Go program will exhibit accidental determinism, but it still seems too difficult to depend on as randomness can be introduced simply by invoking the wrong function, or by using a different runtime version, which to me feels comparable to the hazards of raw multithreading.
While async/await allows for an abstraction over the lower level tasks, that are still exposed, in case one needs more control over the threading runtime.
For example, in JS's case you can still dig into the Promise world if needed.
Similarly in C#, Tasks / Dataflow and SignalR can also be used.
Whereas in Go, correct me if I am wrong, outside CSP one needs to reach out to threads/mutex/semaphore directly.
I'm not sure I understand your sentence. Are you saying that communicating sequential process only works because it is first class in Go or that CSP is not a solution to every concurrency problem ?
I tend to use languages that give library writers (almost) the same control as the language itself has.
EDIT: To expand a little more into what I mean. In most languages that offer async/await, that is mostly syntactic sugar (with some compiler help) to the blessed task pool library.
A good way to explore that is to see the parallel libraries available in C++, JVM, .NET, Haskell and OCaml worlds.
What does streaming APIs have to do with CSP per se?
Could you expand on in what way you think async and await is insufficient with regards to streams? I'm genuinely curious.
I'm interested to see what it looks like.
NDC posts their videos online after each conference, and I did a quick skim. I think it may be this session here, but I haven't double-checked:
Edit: It was a 2-part session and it may also have been in second half. Link here: