Re:Apple’s use of Swift and SwiftUI in iOS 14
by pjmlp on Sunday September 27, 2020 @06:19PM
(#24610604)
That is the ultimate goal, yet stuff like Metal gets written in a mix of Objective-C and C++14, with Swift bindings.
[ Parent
| on HN ]
Re:Apple’s use of Swift and SwiftUI in iOS 14
by nardi on Monday September 28, 2020 @12:02AM
(#24612845)
Correct me if I'm wrong, but I'd bet Metal is almost entirely C++ with a little Obj-C sprinkled on top for the API. And of course C++ is still a better systems language than Swift.
My point was that Swift is better than pure Obj-C for systems programming. Admittedly, that might be a poor comparison, since Obj-C was specifically built to be used alongside C as the systems language.
But yes, I think the ultimate goal is that Swift will be better than C/C++ for systems programming too. It still has a ways to go, and there are a lot of libraries that will need to be written, but I do think it's possible.
Re:Apple’s use of Swift and SwiftUI in iOS 14
by pjmlp on Monday September 28, 2020 @03:01AM
(#24613733)
> Metal is written in Objective-C, is based on Foundation, and makes use of Grand Central Dispatch to synchronize between the CPU and GPU.
https://www.objc.io/issues/18-games/metal/
C++ is used for Metal shaders.