Those compiler optimizations need some work I guess.
Re:Garbage Collection
by tom_mellior on Sunday December 01, 2019 @05:57AM
(#21674896)
Personally, I appreciate you posting this link once, but seeing it this many times gets tedious.
Unfortunately it is hard to give an answer were all advocates of "Swift ARC performance" are able to read, thus urban myths keep being spread.
ARC makes sense given Objective-C compatibility, as otherwise a layer similar to RCW on .NET for dealing with COM/UWP would be needed.
And Objective-C only dropped its tracing GC, because it was too unstable while mixing GC enabled frameworks with classical ones, while making the compiler automatically call retain/release would provide better productivity without being unstable.
Re:Garbage Collection
by tom_mellior on Sunday December 01, 2019 @08:03AM
(#21675273)
I understand the urge to reply in multiple places. I think it would be better to write up some more detailed reasoning, like you did here, and link to this from multiple subthreads. Better than just repeating the same ixy link with a new snide comment each time.
Makes sense.
> too unstable while mixing GC enabled frameworks with classical ones
Actually, you couldn't mix them. The GC simply never really worked properly.
True, however Apple's documentation suggested otherwise, that it was possible "with care".
But as you say, it never worked properly.
I think what you are referring to is "mixed mode" frameworks, which were able to work in both GC and RC environments. You had to do a bit of work to get that.
Which is similar but not quite the same thing. Mixing pure GC and pure RC frameworks was never possible. In fact, I think there were some flags and the (dynamic) linker would balk.
Re:Garbage Collection
by ridiculous_fish on Sunday December 01, 2019 @02:00PM
(#21677165)
Which urban myth do you see being spread in this thread?
ARC outperforming modern tracing GCs.
Re:Garbage Collection
by ridiculous_fish on Sunday December 01, 2019 @02:40PM
(#21677378)
Literally nobody here has said that.
More generally there's an ABI. While to Rust "Arc is just another tool", reference counting is deeply pervasive on iOS and macOS. You would not attempt to pass a Rust Arc to C, and expect something useful to happen. But Clang's ARC works well with C, and Swift, and with ObjC and even with ObjC-pre-ARC. This isn't a critique of Rust, just reflecting different priorities.
1: https://clang.llvm.org/docs/AutomaticReferenceCounting.html#...