Hacker News new | ask | show | jobs
by bascule 4176 days ago
Rust supports both synchronous and asynchronous message passing over its channels. It's true that asynchronous message passing is generally associated with actor systems and not specifically with CSP, but it's also seen in many extensions of CSP, and in fact CSP and actor systems are duals of each other.

Rust supports both approaches.

1 comments

I was wrong about synchronous communication. Since most rust example use async channels, I missed the existence of sync_channel.

However, even if that exists, rust's concurrency doesn't follow CSP as much as go's. Like I mentioned in my previous comment, it doesn't have a way to do everything the select statement in go does. This is not necessarily a bad thing, but rust definitely doesn't share the same concurrency concepts as go. It offers everything that Java/C++ does along with data race protection.

Speaking of data race protection, the current type system rejects a lot of very common "non-racy" code too. There is work in progress to address some of them and may be most of them will be addressed eventually.

> doesn't follow CSP as much as go's

Because it supports asynchronous messaging too? As if CSP were some concept that emerged fully formed from Tony Hoare's head like Athena from Zeus?

I'm sorry you see dichotomies where others see dualities.

I was referring to select statement, not async messaging support.
You mean like the select! macro in Rust?
No the select statement of go. It is way more capable that rust's select macro.

The tone of your previous comment made me feel that this thread is going in an unproductive direction, so I'll stop here.

Considering you've backpedaled from "Rust isn't CSP" (because you misunderstood Rust channels) to "Rust doesn't have select" (which it does, and you didn't realize) to "Rust's select isn't as mature as Go's", that's probably for the best.

Perhaps you should try to be more informed about Rust before you try to have an argument about it in the future!