Re:IBM says Swift is ready for the enterprise
by fauigerzigerk on Monday September 26, 2016 @11:27AM
(#12582608)
You have to manually optimize away unnecessary reference counting without help from the compiler.
[ Parent
| on HN ]
Re:IBM says Swift is ready for the enterprise
by pcwalton on Monday September 26, 2016 @11:50AM
(#12582823)
I have never seen unnecessary reference counting be a problem in Rust. That's because not manipulating the reference count requires an explicit action—.clone()—and borrowing is so expressive that you rarely need to manipulate the counts.
Re:IBM says Swift is ready for the enterprise
by fauigerzigerk on Monday September 26, 2016 @12:18PM
(#12583103)
I guess that's because in Rust you never need defensive reference counting thanks to the borrow checker.
Re:IBM says Swift is ready for the enterprise
by Rusky on Monday September 26, 2016 @01:02PM
(#12583518)
Rust's borrow checker actually helps with this a lot- you can hand out references to the Rc-ed data without modifying the count, and the compiler will enforce that the count is not decremented until the references are dead. Combined with the fact that plain references are more idiomatic than Rc/Arc, this leads to pretty similar results.