News for hackers. Stuff that matters.
Re:Objective-Rust by zozbot234 on Saturday August 29, 2020 @12:57AM (#24313678)
Swift does not do cycle-collecting GC, either. Not really any "higher-level" than Rust, when you look at a comprehensive view of the problem space. And obligate ARC ala Swift has all kinds of performance pitfalls, to the point where it can be even worse than obligate tracing GC.
Re:Objective-Rust by jmull on Saturday August 29, 2020 @09:21AM (#24315877)
Yes. It might help to can think of it this way:

Rust, with the borrow-checker, strong-arms the developer into using memory patterns that the compiler manage handle without the overhead of reference counting or other runtime mechanism.

Those same memory patterns are available in Swift as well, which the compiler can then optimize as well (in theory -- as far as I'm aware there are various unimplemented optimization opportunities in Swift).

So in a sense, in Swift you can opt-in or out of rust-level memory management.

Of course, a big difference is that Rust tells you up-front when you've got it right, but in Swift it's not at all clear. You need to profile. Swift does have a clear delineation between reference types (which use ARC) and values types, so you can get on the right path by choosing value types. Value types in Swift are very rich and powerful so it's not a hard path to follow.

Re:Objective-Rust by smabie on Saturday August 29, 2020 @03:47AM (#24314462)
ARC is GC, and anyone who says otherwise is crazy.
Re:Objective-Rust by saagarjha on Saturday August 29, 2020 @05:45AM (#24314949)
Usually on Apple’s platforms ARC and GC are treated separately because Objective-C has shipped with a conventional garbage collector as well as reference counting and it’s difficult to tell them apart otherwise.