The Dock and a few other components of macOS Sierra are written in 100% Swift, according to this year's WWDC.
The Dock and a few other components of macOS Sierra are written in 100% Swift, according to this year's WWDC.
Choosing the Dock, it's probably one of the smaller end-to-end apps that makes use of many OS features.
So they may have done it purely to prove our Swift for core apps. Now if only they'd have actually updated the UI...
It's probably a reasonably small codebase with well specified requirements, it's a standalone app already, and it's not likely to cause underlying OS performance or stability problems if it lost a little bit of performance migrating to Swift. I'm guessing it could be an experiment to see what parts of the OS are reasonably replaced with Swift?
People have also complained for several yearly releases now that OSX isn't improving as an operating system. It's also been around in various incarnations for like 18 or more years and has likely accumulated some deficiencies that needed addressing. Maybe things need some rewriting now to be positioned to become better in the future and a Swift migration is a good excuse to do both. Enough people are also complaining Apple isn't dogfooding Swift enough internally, so there you go, macOS is starting to dogfood it.
I'd also guess Apple probably has a reasonably hard time hiring for Objective-C positions to work with OS-level code (e.g. they've probably hired all of the existing, interested and qualified people willing to work in the Bay Area already), and the up and coming labor pool of people coming from iOS development is likely to be more interesting in or previously experienced with Swift. Modernizing your codebase where possible now seems like a reasonably way to hedge for the future hiring needs. Apple's been around long enough they likely have people retiring out of some critical positions.
(I believe the Dock "app" also encompasses Mission Control, Spaces and all that sort of desktop interaction wizardry.)
It does. I think it also handles Cmd-Tab. I remember seeing a bug now and then in these things (task switching and desktop spaces etc.) which gets fixed by relaunching the Dock process.
(You can work around this bug by changing some of the defaults in the Mission Control pane of System Preferences... I think the "Displays have separate Spaces" setting.)