5 ms·
Most languages are memory safe. Literally every language with a GC is. C and C++ are pretty much the only 2 languages that are not memory safe by default.
by adgjlsfhk1 3y ago
Most languages are memory safe. Literally every language with a GC is. C and C++ are pretty much the only 2 languages that are not memory safe by default.
- tczMUFlmoNk 3y agoGo is famously not memory safe. Not only can you trivially create data races, if you data race on an interface fat pointer then you can corrupt its vtable (entirely in "safe" code; no `unsafe.Pointer`). It is of course better at memory safety than C and C++, but these issues do come up in real deployments.
- zakkor1 3y agoGood thing Go has a race detector!
- mgaunard 3y agoand C++ doesn't?
- dontlaugh 3y agoData races aren’t memory unsafe. The vtable thing is, but at least that’s accidental.
- mseepgood 3y agoData races have nothing to do with memory safety. Please do not conflate these two. Java, C#, Go, etc. can all have data races, but they are all memory safe languages.
- anonymoushn 3y agoGolang permits safe code to use a data race to cause type confusion and violate memory safety though.
- Thaxll 3y agoGo is memory safe, data races are inherent to all languages beside Rust? As for interface fat pointer it's a none issue in real life code. https://research.swtch.com/gorace https://research.swtch.com/gorace
- astrobe_ 3y ago"Only 2" is very short-sighted, there's also Assembler, Pascal, Ada, Objective-C... One general comment: it's kind of funny to see a C library being bashed right away at V1.0. As far as I can tell, nghtpp2 isn't even a CVE nest to begin with [1]. Some people must be desperate for "easy" targets. [1] https://www.cvedetails.com/vendor/15772/Nghttp2.html https://www.cvedetails.com/vendor/15772/Nghttp2.html