Hacker News new | ask | show | jobs
by Thaxll 1319 days ago
Every GC language by definition are memory safe, memory safety in programming does not mean than accessing the same resources from two thread should be safe.
1 comments

I don't know how it works in other languages, but accessing a partially overwritten slice in Go (as will happen in the presence of data races) can cause your code to access out-of-bounds memory. And as we all know, once you have read/write access to arbitrary areas in memory, you've basically opened up Pandora's box.
Go is memory safe, if not then Java/C#/Python/Ruby are not either.
I don't think you can have data races (but certainly you can have race conditions) in python because of the GIL. I imagine Ruby is similar. Otherwise, no, the other languages you listed are not "memory safe". Once you start reading and writing to arbitrary locations in a process, almost anything can happen. But certainly you can say that there are different degrees of memory safety. All of the languages you mentioned are leaps and bounds above C/C++.