4 ms·
Sure, but you don't need refcounting for cases that are covered by Rust's affine types, even in C/C++. You can use the patterns described in the C++ Core Guidel
by zozbot123 8y ago
Sure, but you don't need refcounting for cases that are covered by Rust's affine types, even in C/C++. You can use the patterns described in the C++ Core Guidelines, and end up with something quite rusty, only without fully-automated checking.
(Besides, I think std::rc has better performance than the refcounts found in Swift and C++, because it's used in cases that don't need atomic update, and yes this is statically checked too.)
- pjmlp 8y ago> You can use the patterns described in the C++ Core Guidelines, and end up with something quite rusty, only without fully-automated checking. Also known as the mythical "only other programmers commit errors, I am always correct".
- asdkhadsj 8y agoYea, I'm not sure what point was being made there. Rust isn't about being faster than C, it's about not letting you make mistakes you can make in C/etc. If you could somehow write perfect code in a timely manner, you'd have no need for Rust. You'd likely also be a unicorn.
- steveklabnik 8y agoYou also only need to bump the counts on Rc<T>/Arc<T> for each owner, not for every reference, which reduces refcount traffic.
- mmirate3 8y ago> only without fully-automated checking The fully-automated checking is precisely what allows one to write unmanaged code without tearing one's hair out.