top | item 44173273

(no title)

adamwk | 9 months ago

The way to write performant Swift is classless so without ARC, but classes have been necessary for many areas. Recently, Swift’s been leveraging a lot of ownership features similar to Rust to make it possible to do more without classes, and I’d guess Apple teams would be using those

discuss

order

sunnybeetroot|9 months ago

What areas are classes necessary assuming you’re talking about pure Swift and not iOS?

adamwk|9 months ago

Where copying is expensive (most Swift collections are backed by classes for COW semantics). Where location stability is necessary (where you need a mutex). Resource allocation. Those are the primary examples that noncopyable types are meant to address.