3 ms·
I can't speak to security as a whole, since security encompasses more than memory safety. But regarding memory safety, they're similar. Rust has an edge in that
by pcwalton 12y ago
I can't speak to security as a whole, since security encompasses more than memory safety. But regarding memory safety, they're similar. Rust has an edge in that it can use hardware parallelism while remaining memory safe, while Go is not memory safe if GOMAXPROCS > 1. However, the memory-unsafe part of Go is a corner (racing on a map or slice) that hasn't caused any real-world security problems I'm aware of.
(Disclaimer: I'm a Rust developer.)
- slimsag 12y agoI generally agree with what you're saying here. The difference appears to be that Rust forces you on a compiler level to be safe of any potential race-condition. Go doesn't enforce this on a compiler level -- but instead it encourages the use of sharing by communicating (over channels, where data races cannot occur), instead of sharing memory e.g. via a mutex (where you can run into a data race).
- steveklabnik 12y agoImportant distinction: Rust forces you to be free of data races, which are a subset of race conditions. A very important subset, mind you, but they're different. It's not really possible to prevent general race conditions, like any form of logic error.