2 ms·
Who is "they"? This isn't Rust. It's still up to the developer to follow the advice. Anyway, I would stop short of saying "Go chose shared memory". They've alw
by bloppe 11mo ago
Who is "they"? This isn't Rust. It's still up to the developer to follow the advice.
Anyway, I would stop short of saying "Go chose shared memory". They've always been clear that that's plan B.
- dontlaugh 11mo agoGo's creators said "Don't communicate by sharing memory", but then designed goroutines to do exactly that. It's quite hard to not share memory by accident, actually. It's not like it's a disaster, but it's certainly inconsistent.
- bloppe 11mo agoI don't think allowing developers to use their discretion to share state is "certainly inconsistent". Not sure what your threshold is for "quite hard" but it seems pretty low to me.
- dontlaugh 11mo agoGoroutines could've lacked shared memory by default, requiring you to explicitly pass in pointers to shared things. That would've significantly encouraged sharing memory by communicating. The opposite default encourages the opposite behaviour.