Comment by typical182
8 hours ago
Go is broadly considered to be a memory safe language.
See for example comments from tptacek like:
https://news.ycombinator.com/item?id=44672371
(The gist: memory safety is a term of art coined by security practitioners. Go, Python, Rust, Java, others: memory safe. C/C++: memory unsafe. Periodically, people in different slices of industry or academia come up with new definitions of memory safety that declare Rust or Go or other languages to be memory unsafe, but that is not by the broadly accepted definition across industry.)
Rust does allow you to overflow buffers, confuse types, and duplicate mutable pointers in safe code. See cve-rs.
No, Rust does not allow that. The current Rust compiler does, but that’s a bug that is being fixed.
At some point in the future, a fully backwards compatible Rust compiler will report an error when you try to compile cve-rs.
Since we are not at some point in the future where that correct compiler exists and there is only one official compiler, the distinction you make is practically meaningless!
1 reply →
Isn't one of the bugs around ten years old, now? Isn't ten years enough to call something a feature of the language rather than a bug?
I like Rust, but with this bug existing for so long, I personally no longer think of it as memory-safe.
1 reply →
I define undefined behaviour as a bug in C++. Now C++ is memory-safe!
btw, it's not actually that hard to write correct code in C++, easier than in C because you have all the container types. The problem is that nothing will tell you when you write incorrect code - there's no guarantee.
2 replies →
And yet, there's a C compiler (fil-c) that doesn't allow that.
He’s very wrong about this. Just because ‘tptacek posts a lot and did security once upon a time does not make him “broad consideration”.