← Back to context

Comment by adastra22

4 years ago

This looks like not a reskin of an existing FreeBSD or Linux windows system, but an actual reimplementation of macOS. Very interesting if they can pull it off!

I wonder though, why start with old Objective-C cocoa APIs instead of Swift?

Objective-C is the ABI of all UI-related macOS frameworks and it would probably always be. Even if you're writing in Swift, as long as you're using AppKit, you're using Objective-C classes under the hood. There's no such thing as "Swift Cocoa APIs". And SwiftUI is an abstraction layer on top of, again, AppKit/UIKit/WatchKit, which are themselves all written in Objective-C.

The greater bulk of the macOS userland is still written in Objective-C.

  • Yeah but they expose the same ABI. If you can write in Objective-C, you could write it Swift and externally it'd be no different. And since they're reimplementing this stuff from scratch, I'm surprised they didn't just do that.

    (I'm saying this as someone who would be more inclined to contribute if it was written in Swift.)

It's a BSD. (Knowing that, you probably wouldn't ask them, "Why C and not C++?") As a language (and ecosystem*) Objective-C is mature and lacks complexity in a way that doesn't apply to Swift.

* They definitely did not start with Objective-C and a blank slate here; they're folding in monumental amounts of third-party code

I wonder if Cocoa is that language specific or if it’s become legacy tech. When Swift was announced and when I explored it for personal projects, I was very much calling Cocoa APIs. They definitely catered to ObjC-isms, but my impression was that all of the underlying UI frameworks were being preserved even if they might gain additive APIs to be used less awkwardly in Swift.