4 ms·
Rust doesn’t implicitly create bug free code. I’ve created lots of bugs in Rust. But there are classes of bugs that the language eliminates. Thread unsafe data
by bluejekyll 8y ago
Rust doesn’t implicitly create bug free code. I’ve created lots of bugs in Rust.
But there are classes of bugs that the language eliminates. Thread unsafe dataraces (not important in JS), unhandled exceptions, with no GC it helps reduce memory usage and make it more consistent, the type system allows you to build complex state machines easily and correctly, the type system itself can allow you to express states that should never occur as compilation failures, the compiler protects against concurrent updates in iterators and other situations.
The list goes on, but these are the things that make it such a powerful language and allow me to focus on logic and not runtime bugs. Oh, and it’s really fast which is a nice bonus, generally as fast as C.
- wwright 8y agoTo add: safe Rust prevents all data races, not just thread based ones (this is mostly relevant around iterators and other concurrency-without-parallelism structures, but is relevant more generally as well)