2 ms·
> There are many many libraries available in rust due to the amazing dependency system. But the average quality is quite poor. The main problem with Rust is th
by Jensson 4y ago
> There are many many libraries available in rust due to the amazing dependency system. But the average quality is quite poor.
The main problem with Rust is that it is thread safe, and that makes code and libraries very hard to write. Thread safety is a lot stricter than memory safety, and since it is easy to write single threaded memory safe modern C++ it gets hard to shift to Rust.
But if you want thread safety or mostly do data processing scripts then Rust is far superior, just that for many applications enforced thread safety is an anti feature since it makes your code way too hard to work with. If they could make ergonomic thread safe libraries for everything then great, but I really doubt it will ever happen as it is very hard to do.
- surajrmal 4y agoThis is a common misconception. Not all rust code is thread safe. You can use and implement types like Rc which are !sync. What rust enforces by default is concurrency safety. For instance iterator invalidation is something which can occur on a single thread, but rust prevents it from occurring. Of course rust can enforce thread safety as well, but you're allowed to write code which is not thread safe. Contrast this with c++ where it's hard to know the context in which your code will be run so you may end up preemptively making it thread safe, like in the case of std::shared_ptr.