7 ms·
Your question is reasonable; I don't think you should have been downvoted. That's indeed one of the major advantages of Rust but it's not the only reason peopl
by School-Cotton 2y ago
Your question is reasonable; I don't think you should have been downvoted.
That's indeed one of the major advantages of Rust but it's not the only reason people like the language. Just to give an example, you can write concurrent code without ever worrying that you accidentally failed to protect something with a mutex; whether some code is thread-safe or not is encoded in the type system and violating thread safety is a compiler error. This is a huge advantage that has little to do with lack of GC.
- throwaway81523 2y agoI wonder if there is an STM (software transactional memory) implementation that uses the borrow checker that way, similar to how Haskell's STM monad uses Haskell's type system to ensure nothing leaks.