Hacker News new | ask | show | jobs
by joewillsher 3701 days ago
Most apple platform apps are written in mostly objc or Swift and not C++, I wouldn’t say it is one of the most widely used languages on these platforms by any means. The Cocoa SDK exposes an objc interface so many system framework calls have to use swift or objc.

Secondly, compilers are a very different programming task to developing GUI apps; the Swift team choosing to use it has nothing to do with Apple’s assessment of how you should write an application—Apple are the people who have been leading objc development (they own the objc IP) in the last 10 years and use it in all first party apps and many system frameworks.

3 comments

It depends, most of important and heavy lifting stuff in Apple platform, aka Core frameworks, are written in C, for example a quote from Core Text documentation [1]:

> Many of the low level libraries in OS X and iOS are written in plain C for speed and simplicity.

And don't forget that OSX/iOS are based on Darwin BSD, where most of heavy lifting is done by programs written in C.

- [1] https://developer.apple.com/library/mac/documentation/String...

Yeah, I still wouldn’t say that c++ is “one of the most widely-used languages for writing native apps” for OS X.

And internally apple use other languages a lot, but frameworks like UIKit, AppKit, and many of the other public frameworks they expose in the SDK are objc, with foundation for example abstracting a lot of CoreFoundation C code.

Perhaps most smaller apps, yes. And some big ones too. But a very significant percentage of the commercial software industry writes apps for OSX in C++, including Autodesk, Adobe, many major games written using engines like Unreal and Unity (which also support other languages), etc.

That's not a knock against anyone who does or doesn't write apps in a particular language; but folks should know what the reality is, and Objective C or Swift are by no means the only or even necessarily the most profitable ways to writes apps for OSX, though those languages are perfectly fine for many circumstances.

Is there an actual half-popular production app for OS X written in Swift yet?
Probably not, but Lyft is an iOS app written in Swift.