Hacker News
points by afdbcreid 4 days ago | 0 comments
Java vs. Kotlin is a different matter. It's still an open question if C++ even could match Rust's features, not to say if it (the committee) wants to, and the answer seems to be "no".
[–] gmueckl 4 days ago
The feature parity question goes both ways: rust won't ever be able to express some things that are possible in C++.
[–] afdbcreid 4 days ago
Like?
[–] gmueckl 4 days ago
Algorithms that safely mutate the same data structure on multiple threads and do so safely because of some complex algorithmic properties that guarantee that the changes do not overlap?
[–] afdbcreid 4 days ago
Rust can do that just fine. https://doc.rust-lang.org/stable/std/cell/struct.UnsafeCell..... "some complex algorithmic properties that guarantee that the changes do not overlap" are exactly the place to use unsafe and encapsulate it.

If you mean things that formally create a data race, then C++ cannot do that either.

[–] tcfhgj 4 days ago
Why can Rust not do that?
[–] gmueckl 4 days ago
How do you create shared mutable ownership of overlapping ranges of a single flat array in rust?
[–] tcfhgj 4 days ago
similarly except the algorithm to Mutex<[T]> and Arc?
[–] gmueckl 4 days ago
How does this work e.g. for an array of integers that several workers threads write to at random, non-overlapping positions?