Live data from Hacker News

Apple announces full Swift rewrite of the Foundation framework (2022)

infoq.com

111–120 of 402 posts

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#111
post #89

So apple seems to be dropping c like languages, Microsoft says new stuff should not be written in c like languages anymore, and google has steadily worked towards using rust and go in place of c and c++ where it makes sense to do so it seems. There seems to be a trend here.

>>Microsoft says new stuff should not be written in c like languages anymore Microsoft is dropping C#? Source for that?

C# is C-like in syntax only.

Syntax isn't the reason why C and C++ are falling out of favor.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#112
Correction: rewrite of PARTS of Foundation

There already was an open-source project to rewrite ALL of foundation, but it had stalled on the shores of having to re-implement everything:

  https://github.com/apple/swift-corelibs-foundation
The news is actually that Apple is now instead trying to define the bits/parts to support via Swift on all platforms (the original API's will always be supported on Darwin).

The announcement:

  https://www.swift.org/blog/future-of-foundation/
The discussion, with hairy details about which bits, esp. for async:

  https://forums.swift.org/t/what-s-next-for-foundation/61939/103
The plan is to divide up Foundation into more- and less-essential parts, to get more-essential parts locked down so people can rely on them.

What's Foundation? Swift's most-core library is the stdlib, tightly coupled to the compiler/language version, providing things like arrays, dictionary, etc., and available wherever Swift is. Beyond that, Foundation is the library with core API's for common features, e.g., for dates and concurrency. Stdlib is fully cross-platform and Swift-specific, but Foundation is a beast with API's dating to NExT with support for 20 years of API's.

Microsoft famously arrived at porridge for an operating system by maintaining backwards compatibility. Apple has cracked open Swift by developing in the open, but it's still Apple-funded and Apple-driven. Library and some integration support for other platforms has always had to come from community (notably compnerd's heroic effort to make-things-work on windows, and a revolving cast wanting Linux support for their server API's).

But there's no good reason to impose the whole Foundation history on other platforms. And there may be a movement inside Apple to migrate internal code to newer async API's, designed after the recent Apple-silicon generation.

For developers with server experience and some free time in a tech lull, it could be a good opportunity to help rebuild a new, er, foundation for computing on all devices, that's native but type- and memory-safe. The community is large and mature, but there is plenty of room for others.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#113
post #89

So apple seems to be dropping c like languages, Microsoft says new stuff should not be written in c like languages anymore, and google has steadily worked towards using rust and go in place of c and c++ where it makes sense to do so it seems. There seems to be a trend here.

Forgive me, is swift not in the c family? I could have sworn that it was, but I'm not overly familiar with it.

Lots of languages, including Java and Javascript, have been described as being "in the C family", but this papers over a whole lot of important details. Swift is a low-ish-level imperative-ish language with C-ish syntax.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#114
post #89

So apple seems to be dropping c like languages, Microsoft says new stuff should not be written in c like languages anymore, and google has steadily worked towards using rust and go in place of c and c++ where it makes sense to do so it seems. There seems to be a trend here.

The writing has been on the wall for decades for anyone who was paying attention. But it takes time for a whole industry to shift.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#115
post #89

So apple seems to be dropping c like languages, Microsoft says new stuff should not be written in c like languages anymore, and google has steadily worked towards using rust and go in place of c and c++ where it makes sense to do so it seems. There seems to be a trend here.

Forgive me, is swift not in the c family? I could have sworn that it was, but I'm not overly familiar with it.

I would think it is. It runs on the Objective-C runtime and has interop with it and C.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#116
post #112

Correction: rewrite of PARTS of Foundation There already was an open-source project to rewrite ALL of foundation, but it had stalled on the shores of having to re-implement everything: https://github.com/apple/swift-corelibs-foundation The news is actually that Apple is now instead trying to define the bits/parts to support via Swift on all platforms (the original API's will always be supported on Darwin). The announ…

[deleted]

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#117
post #43

What remaining Apple frameworks are not yet written in Swift?

Most of them. Very few frameworks are actually written primarily in Swift.

Would the macOS kernel (Mach) ever be rewritten in Swift?

And if so, what benefit would it provide?

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#118
post #75

Could someone please explain what exactly is the “Foundation”?

It’s not respectful to not read the link and instead ask somebody to summarise it for you.

You’re making the wrong assumption! I have read the article before I asked, and still have no idea what it is! Saying it provides these abstraction NSObject, NSString, NSArray tells me nothing! The article is clearly written towards readers familiar with Apple ecosystem.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#119
post #20

I am pretty certain that most of high level use cases for Rust could be replaced with Swift, with increased developer velocity, if Swift was actually cross platform. And that's coming from a Rust fan. It will be interesting to see how effective this rewrite is.

I think the fact that Rust won't provide inheritance based OOP workflows means that something like swift will always be valuable, especially for application development.

Re: Apple announces full Swift rewrite of the Foundation framework (2022)

#120
post #113

Earlier quoted context omitted.

Forgive me, is swift not in the c family? I could have sworn that it was, but I'm not overly familiar with it.

Lots of languages, including Java and Javascript, have been described as being "in the C family", but this papers over a whole lot of important details. Swift is a low-ish-level imperative-ish language with C-ish syntax.

You could just as plausibly say that Swift is a high-ish-level functional-ish language with a modern syntax. Whereas C blows up at runtime, Swift nags-and-whines at compile time - in that way it's very unlike C. All that said "in the C family" is highly ambiguous at best...
Post reply on HN