News for hackers. Stuff that matters.
Re:Writing Gnome Apps with Swift by frizlab on Wednesday March 27, 2024 @07:07PM (#39845711)
ARC is for classes, structs use don’t have that and classes are heavily discouraged.

DispatchQueue is anything but fork/renice. Also there is async/await now. GCD should be used for concurrent work only now, not async work.

Memory protection is fully implemented in Swift 5.10, but compilation only warns, enabled by default as errors in Swift 6.

Re:Writing Gnome Apps with Swift by cageface on Wednesday March 27, 2024 @08:24PM (#39846338)
I really like the struct-based method of modeling data in Swift. The language makes this very convenient. Unfortunately the new Observation framework which is at the center of SwiftUI requires classes.

https://forums.swift.org/t/any-future-directions-for-support...

Re:Writing Gnome Apps with Swift by amomchilov on Thursday March 28, 2024 @12:50PM (#39854175)
This makes sense, observation requires a durable identity, which structs don’t have.

Two struct might be the same, but when I observe for changes in one, but not another, a distinction arises which is best captured by object-based identity