3 ms·
Kind of ironic the raison d'être of Go is a memory safe language for concurrent programming but you can easily footgun yourself into doing something memory unsa
by vore 3y ago
Kind of ironic the raison d'être of Go is a memory safe language for concurrent programming but you can easily footgun yourself into doing something memory unsafe using concurrency...
- 65a 3y agoGo generaly doesn't used shared memory and concurrency, or at least it's been considered an anti-pattern: https://go.dev/blog/codelab-share https://go.dev/blog/codelab-share
- vore 3y agoYes, but at the same time shared memory concurrency is not considered an unsafe usage of Go either...
- masklinn 3y agoThat is dishonest. Implicitly shared memory is literally the default behaviour of the langage, and you have to be careful to keep that controlled or contained. Pretty much as in every other shared memory concurrency langage. The quip about sharing memory by communicating is cute but it’s just that, the langage does not encourage let alone enforce it. In fact it went out of its way to remove some opportunities e.g. because `go` is a statement there is no handle which could communicate the termination and result of routines.