I've seen this one come up a few times in PL threads too... despite what some believe, Go is not a memory safe language!
-
Erin 💽✨replied to Asahi Lina (朝日リナ) // nullptr::live last edited by@lina I definitely think we need to distinguish "strong memory safety" (impossible to break memory safety; Rust) from "weak memory safety" (impossible to break memory safety without data races; Go and I think Swift?) because both of these are very distinct from no memory safety at all (C, I think Zig?)
-
Asahi Lina (朝日リナ) // nullptr::livereplied to Erin 💽✨ last edited by
@erincandescent Maybe we should call them "single-threaded memory safety" and "concurrent memory safety"?
It's a pretty big distinction though, because most complex programs these days are multithreaded! Having single-threaded memory safety is definitely better than not, but can't really provide any hard guarantees once you throw threads in the mix.
-
Erin 💽✨replied to Asahi Lina (朝日リナ) // nullptr::live last edited by@lina you can't provide guarantees but my experience is that threading related safety bugs are much more rare, and I think they've also proven much harder to exploit in practice
-
etareplied to Asahi Lina (朝日リナ) // nullptr::live last edited by
@lina the main thing that spooks me out about Go's attitude to concurrency is the remarkable lack of documentation about what is safe to do from multiple threads versus not; I'm used to Rust having Send and Sync, but it seems in Go you just have to guess?
-
-
Morten Linderudreplied to Asahi Lina (朝日リナ) // nullptr::live last edited by
@lina
But does this work the reverse way? There are multiple known soundness issues with rustc that can lead to memory issues or segfaults.Where do you draw the line when saying something is and isn't memory safe?
-
@erincandescent @lina it's going to depend a lot on your domain I think, in (large) games at least a *lot* of issues come from the combination of threading and memory unsafety.
-
-
Morten Linderudreplied to Josh Simmons last edited by
-