3 ms·
> (requiring mutexes over channels to avoid breaking qualifies as broken) I've used Go channels plenty of times without any explicit mutexes, so I'm not sure w
by burntsushi 7y ago
> (requiring mutexes over channels to avoid breaking qualifies as broken)
I've used Go channels plenty of times without any explicit mutexes, so I'm not sure what you're talking about here.
- hajile 7y agohttps://www.jtolio.com/2016/03/go-channels-are-bad-and-you-should-feel-bad/ https://www.jtolio.com/2016/03/go-channels-are-bad-and-you-s... I'd add that these aren't just theoretical (EDIT: I forgot that his article linked to this paper). https://songlh.github.io/paper/go-study.pdf https://songlh.github.io/paper/go-study.pdf Go doesn't actually implement CSP correctly. That would require some changes. This provides a high-level overview. https://stackoverflow.com/questions/32651557/golang-main-difference-from-csp-language-by-hoare https://stackoverflow.com/questions/32651557/golang-main-dif... Threading is hard and gets a lot harder when you introduce pointers or mutable data. This is even harder when your type system is terrible. I suspect that Go trying to solve this would result in a language that looked a lot like Rust with a Garbage Collector.
- burntsushi 7y agoYou've gone from "Go channels are broken because they require mutexes to use" to "Go doesn't implement CSP correctly." The former is demonstrably not true and the latter is academic. (Although you did reference a good study on concurrency bugs in Go, but this seems unrelated to either of your claims.) You aren't doing your argument any favors when you're so hyperbolic. Go channels are manifestly not "broken." > I suspect that Go trying to solve this would result in a language that looked a lot like Rust with a Garbage Collector. And yet you honestly can't understand why the designers of Go didn't go down that path? Rust is significantly more complex than Go and much harder to learn.
- jtolds 7y agoThe latter being academic doesn't mean it is not also of practical import to correct usability.
- burntsushi 7y agoNever said it doesn't. But no further explanation was offered. Bottom line for me is that if you're going to be snotty about something, then at least be correct. Or better yet, don't be snotty in the first place.