3 ms·
Yes. Rust has safe destructor semantics. C++ does not. Back references are really hard in Rust. You can do them with Rc, RefCell, and Weak, but there's a lot o
by Animats 2y ago
Yes. Rust has safe destructor semantics. C++ does not.
Back references are really hard in Rust. You can do them with Rc, RefCell, and Weak, but there's a lot of run-time checking involved. More static analysis could eliminate most of that run-time checking. .borrow(), .borrow_mut(), and .upgrade().unwrap() panic if they ever fail. So you really want to prove they can't fail. If you can do that, you don't need the run-time checks. In that direction lies the solution to Rust's limited data structure problems.