3 ms·
> Go is focused on concurrency as a first class concept. That is not to say you cannot find aspects of Go’s actor oriented concurrency in Rust, but it is left a
by oconnor663 9y ago
> Go is focused on concurrency as a first class concept. That is not to say you cannot find aspects of Go’s actor oriented concurrency in Rust, but it is left as an exercise to the programmer.
To be fair, concurrency is baked the Rust type system itself. It's certainly a first class concept. I think the better way to describe it is that Rust wants to make concurrency safe regardless of what mechanism it's based on (system threads, futures/asyncio, maybe other things eventually?), while Go wants to provide a particular (very convenient) mechanism as part of the language.
- aplanas 9y agoI do not see that concurrency is a first class concept in Rust at all. The only mechanism that is in the language are the Send and Sync traits, and is even partially out of it. Rust do not have language constructs for any concurrency/parallel model, and this is a good thing. You can use fork-join, parallel iterators, mutex, rwlocks, channels (mpsc, mpmc...) or any other model as a library. The nice thing is that, as you say, is the type system the component that guarantee a free from data race code in safe Rust.
- oconnor663 9y agoYes I think we're mainly using "first class" to mean different things, but we can both agree that Rust and Go have both been designed very carefully around concurrency :)