News for hackers. Stuff that matters.
Re:Advice for the next dozen Rust GUIs by pjmlp on Sunday July 17, 2022 @02:52AM (#32124992)
With the small difference that Swift compiler is RC aware and optimizes them away, unlike Rust, first point.

Second point, exactly because it is opaque, its ergonomics are way better than Rust code.

No Rc, Arc, RefCell, clone(), Pin, pollution across the source code.

Re:Advice for the next dozen Rust GUIs by buildartefact on Sunday July 17, 2022 @04:53AM (#32125415)
Optimises what away exactly?
Re:Advice for the next dozen Rust GUIs by pjmlp on Sunday July 17, 2022 @07:51AM (#32126017)
The reference counting code that can be proven to be unnecessary, given the execution flow of the code.

Rustc doesn't possess such knowledge about library types.

Re:Advice for the next dozen Rust GUIs by dataangel on Sunday July 17, 2022 @09:13AM (#32126476)
Rust is capable of eliminating unnecessary count increments and decrements for Rc fairly often. The compiler doesn't usually need specific knowledge -- if there is a +1 and then a -1 LLVM is smart enough to cancel that out on its own. I'd actually be curious to see examples where it doesn't.
Re:Advice for the next dozen Rust GUIs by pjmlp on Tuesday July 19, 2022 @05:29AM (#32149324)
Me too, because that is the usual hoping the compiler does the right thing, tied to LLVM, and not part of language semantics.
Re:Advice for the next dozen Rust GUIs by buildartefact on Monday July 18, 2022 @12:57AM (#32134841)
I mean, how often are you cloning an Rc? It’s not like c++ where passing a shared_ptr to a function is going to copy it. Most of the time you’re going to move it.
Re:Advice for the next dozen Rust GUIs by pjmlp on Tuesday July 19, 2022 @05:30AM (#32149329)
In GUI designers, everywhere.