News for hackers. Stuff that matters.
Re:Rust 1.42 by saagarjha on Thursday March 12, 2020 @01:33PM (#22559383)
I would steer you away from Rc and Arc unless you know you need them.
Re:Rust 1.42 by hathawsh on Thursday March 12, 2020 @01:50PM (#22559607)
Perhaps. I can think of a couple reasons to steer people away from Rc/Arc: they are less efficient than references and they don't support cyclic garbage collection. On the other hand, Rc/Arc are very helpful for newcomers coming from garbage collected languages and they can be more efficient than cloning. If I asked an employee to convert some high level module to Rust and that employee used a lot of Arcs where they weren't really necessary, I would say that employee had done a reasonably good job.
Re:Rust 1.42 by pjmlp on Friday March 13, 2020 @02:31AM (#22565226)
They are unavoidable with most GUI bindings on Rust, actually it is a plethora of Rc<RefCell<>> across the code.