4 ms·
Locks are not easy to reason about, period. Rust makes it particularly easier; I shudder about doing similar logic in any other language without this level of t
by Daishiman 5y ago
Locks are not easy to reason about, period. Rust makes it particularly easier; I shudder about doing similar logic in any other language without this level of tooling.
- jeffrallen 5y agoChannels are easy to reason about. If the language that gives me channels asks me to let it manage memory too, then cool, fine with me.
- zesterer 5y agoChannels are most definitely not easy to reason about in the slightest. Superficially, they might appear to be on the surface: but they're really not and have innumerable subtle cases and behaviours in the face of various kinds external conditions, scheduling behaviours, etc. They only start to become 'easy' in a language that utterly ignores all other paradigms, interoperability, and performance concerns as in Go.
- Daishiman 5y agoThey're easy to implement; terribly difficult to reason about from a correctness point of view, which is really all that matters in performant multithreaded code. Given that it can take weeks to debug a deadlock, I am more than happy to pay the price of some boilerplate and difficult types if that helps correctness.