Hacker News new | ask | show | jobs
by littlestymaar 206 days ago
> It might be counterintuitive, but garbage collectors in multithreaded code can be very efficient.

It is indeed. But on the flip side, no other programming language is going to give you a compile error if you forgot to wrap you data into a mutex before sharing it between threads, and you'll either end up with a ConcurrentModificationException exception at runtime (Java) or with an undefined behavior.

But otherwise yes, there are plenty of situations where a GC is a totally valid solution. Just not for most of Rust's niche.