Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Go is a safe language? It has garbage collection and performs checks for things like buffer overflows and use-after-free


(Memory) safe languages are allowed to guarantee memory safety at any stage, including at runtime using GC and bound checks. That makes every GC language memory safe to a reasonable extend. The novelty in Rust is that it does the same at compile time, mostly automatically.


You can have data races in "safe" Go. If you race a trivial object [such as an integer] it's just radioactive and so long as you didn't need it to have any particular value (e.g. you were just going to write it to a log anyway, or you just discard it) you're fine. However if you race a non-trivial object then that's immediately Undefined Behaviour.

Of course Go programmers will say "Just don't do that" but that's exactly what C programmers told us about bounds misses, use after free and so on...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: