Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

>Out of all the binaries in iOS 15:

89% are using Objective-C

17% are using C++

13% are using Swift

8% are entirely written in C

2% are using SwiftUI

Objective C looks healthy.



They have like, at a minimum, 10+ years of a whole OS built on objc. Of course it's going to be a high percentage.

I would be weary of any team who decided to rewrite an OS in an emerging language.


More like 20+ given the NeXT heritage.


Wouldn't most binaries not have UI anyways? Probably better to compare Swift UI to previous UI frameworks.


Swift was conceived and sold as an all purpose language. To an extreme degree, in fact. Lattner has said many times that it's intended from scripting to system programing[1]. Currently it's good at neither.

I think a language that's simultaneously productive at this two extremes is impossible, but it was their goal.

[1] https://developers.slashdot.org/story/17/01/23/085232/slashd...

“In short, I would NOT say that Swift is an extremely compelling systems programming or scripting language today, but it does aspire to be great for this in the years ahead.”

Jan 2017


I’ve had very few complaints with Swift as a backend language in all honesty.

I can see it as a backend/systems language. It is not a scripting language.

The issue is the stewardship of the ecosystem.

The fact the Foundation library is closed source is a complete joke in this day and age.

Apple’s lack of effort towards fostering a broader community for its language is a comedy of errors.

A Swift developer will spend much time dealing with undocumented closed source packages.

It’s almost comedic how retro it is. It’s like coding in the 1980s.


The Foundation library on non-Apple platforms is open source: https://github.com/apple/swift-corelibs-foundation and intended to reach parity with the Apple version.

> Our primary goal is to achieve implementation parity with Foundation on Apple platforms. This will help to enable the overall Swift goal of portability.


But why are these even two separate libraries? Is it normal for different platforms to have different implementations of the standard library? I'd assumed that most of the library would have been written in Swift itself, which should theoretically make it be as platform-independent as Swift is.


Foundation is not the standard library of Swift. Swift has its own standard library that is bundled with the language on all platforms that are supported.

And Foundation itself isn't written in Swift, a good portion is written in C.

> A significant portion of the implementation of Foundation on Apple platforms is provided by another framework called CoreFoundation (a.k.a. CF). CF is written primarily in C and is very portable. Therefore we have chosen to use it for the internal implementation of Swift Foundation where possible. As CF is present on all platforms, we can use it to provide a common implementation everywhere.

https://github.com/apple/swift-corelibs-foundation/blob/main...


This is assumption from first principles

The Apple versions of foundation have to be compatible with the Foundation/CoreFoundation equivalents. They also have more than a decade of binary compat to maintain


If it were extremely well documented with a lot of nice examples the open/closed nature of the libs would be a secondary question.


> The fact the Foundation library is closed source is a complete joke in this day and age.

Foundation is open source https://github.com/apple/swift-corelibs-foundation


Sometimes I think an Objective-C 3.0, that would break with some of more problematic C flaws would have been better, even though I dislike @ and [] everywhere.


The question is, where does ObjC end and where does Swift start? When Apple announced an Objective-C without the C, I assumed they'd keep the Smalltalk object system and message passing. It still boggles my mind that they took a hard turn into the world of value semantics and extremely static types, with all the ABI problems that we know from C++, plus all the interop hacks to bridge both worlds. The syntax almost seems like a superficial detail compared to the new object model.

On the other hand, the Smalltalk model would not have worked for SwiftUI. It really feels like Apple has bet the farm on the next generation of libraries/frameworks.


Not sure if they bet the farm as such, there are plenty of rants regarding how unsuitable SwiftUI is outside iOS for macOS workflows.


It’s not impossible — Lisp exists and has been used in both contexts for decades.

Swift needs some work to get there. There are a huge number of gaping holes, but these would be a start:

- scripting: a native RegEx literal type

- systems: replace Codable with something easier to use/more performant

- systems: better logging interface

Edit: formatting


How successful are Lisp OSs?


Came here to post the same. We tend to spin around the shinny and new. These numbers, even if a but inaccurate, are sobering and show who's really running the show.


Every year the supporter of Swift will claim new project are all going to be Swift right down to system level. And every year they have been wrong. It doesn't seems Swift is replacing Object-C in system level usage anytime soon. And only even partly in applications. May be Swift 6, when they finally introduce ownership. But that is looking more like 2023 at the earliest.

It will be worth looking at the stats again in 2024, 10 years after Swift was introduced.


If even Apple is writing more new software in Obj-C than they are in swift, its probably still a fantastic time to learn obj-c and use it to develop applications.

Or at the very least, use Swift + UIKit rather than SwiftUI.


I think this the wrong take from the data.

Apple is writing 'more Obj-C' because it's their incumbent language, and they are 'writing a lot more software'. As the basis expands, it's going to expand along the normative vector, which is ObjC.

But for outside devs, Apple has almost frozen ObjC in favour of Swift, and Swift is 100% the future for apps built for iOS/MacOS.

Even externally, ObjC will probably be supported for a 'very long time' and maybe even perpetually at this point, it's really not the future.

Internally, the sands have not shifted, but I suggest that within about 5-7 years Swift will be on even footing with ObjC even within Apple.

So if you're an Apple focused Dev. not working for Apple ... then Swift is probably your #1 focus with a 'Healthy Knowledge' of ObjC - at least enough to access arcane and un-ported APIs as a nice thing to round out your skills.

ObjC is losing popularity, it will be a 'well supported' niche language going forward. You can probably bank on your ObjC skills for a long time to come, but in a more narrow range of opportunities.


> But for outside devs, Apple has almost frozen ObjC in favour of Swift

In my experience, Apple doesn't even have to freeze anything because the iOS developer community (outside of Apple) is full of proud Early Adopters. Sometimes it feels like a race to use the latest tools on day one. I haven't seen anyone looking for ObjC developers from the day Swift was announced.


It's not 'who's running the show' it's just 'incumbency of legacy'.

Modules that are complicated and not broken, are extremely expensive to fix esp. when they need to develop new stuff.

Legacy and backwards compatibility have a way of keeping things around.


Have you seen the graphs? From what I’ve gathered, the amount of ObjC has been steadily increasing.

It’s not in maintenance legacy mode. It’s thriving.


Nobody is going to do a 'new start' in Obj-C outside of Apple so it's now a language used for 'One Companies Internal Purposes', moreover, swift in just the last 2 releases has gained significantly - they're just starting to use it.

My bet is that even then, most ObjC use is due to legacy - most of those binaries are probably related to apps that are already in ObjC.

I looks like they plan to keep it around for the foreseeable future, but I wonder if it will mostly be eventually replaced by Swift for new starts.


ObjectiveC is slowly dying [1] I think it will flatten out and not go away for a long time but it's going to eventually become and adjunct to Swift 'outside' of Apple.

Within 5-7 years Swift will rival ObjC within Apple, and from then on it's hard to tell.

There are no foreseeable plans to rewrite the OS, and so ObjC has to stay around, but that's in a clearly limited capacity.

[1] https://www.benfrederickson.com/ranking-programming-language...


They better rewrite Metal by then than.


Yes, ObjC will have to stick around for as long as those things.

But Metal will eventually be re-written. Not for a while, but eventually.


I don't think so, it is like the .NET uptake at Microsoft, after 20 years, no matter what, the WinDev is C++ deep down to their bones, nowadays even more since COM has won the Longhorn wars.

Objective-C will be just the same at Apple, specially since their creators decided to go search for other adventures outside Apple.


Facebook is writing all their iOS apps in Obj-C(++).


Facebook can afford it.

Very few companies can.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: