Live data from Hacker News

Apple is rewriting Foundation in Swift

github.com

51–60 of 263 posts

Re: Apple is rewriting Foundation in Swift

#51

Earlier quoted context omitted.

It's how they've always done things. It was about 10 years after the last 68k Mac shipped before the entire classic OS was power. Same with moving everything from carbon to cocoa.

(Mac OS 8/9 was never fully PowerPC native.)

Because some 3rd party software either wasn't PPC, or hadn't actually tested their PPC support so it couldn't be used, or in some cases interpreting the 68k code was actually faster due to cache sizes.

Re: Apple is rewriting Foundation in Swift

#52

Long overdue -- there's a very noticeable difference in runtime errors with Swift libraries vs the rest. This is especially true of AVFoundation, which is an absolute mess of hidden and undocumented state. Swift optionals and enums will go a long way to fixing that.

This will not directly affect AVFoundation, or any other framework which is not Foundation itself.

Not as part of the work from this announcement, no, but it is surely an indication that Apple is moving in a direction where those other libraries will eventually be re-written in Swift too.

Re: Apple is rewriting Foundation in Swift

#53

I just... completely don't understand the appeal of Swift beyond it being Apple's in-house language. I was excited for Foundation to become open-source. Using a language you'll really only find in 1 environment is a negative. I'm going to go feel ashamed for not getting excited about a language now. I should be celebrating "more languages", but Swift is just Apple. No one outside Apple chooses Shift unless they want…

Seems a lot of people feel the way you do. I had to make something using swift once, and could barely find a community to help me decipher the cryptic swift documentation centered around their coreml library. Apple is keeping Swift on life support, imo.

Re: Apple is rewriting Foundation in Swift

#54
post #27

Earlier quoted context omitted.

Catch data races at compile time?

I don’t know much about Rust, but Swift can prevent data races at compile time by using the Actor type.

It could catch them before that using ownership, at the cost of lower performance.

Though Swift concurrency is mostly about "concurrency" not "parallelism", which is the one that has data races.

Re: Apple is rewriting Foundation in Swift

#55
post #2

Considering Swift 1.0 was released in September 2014 I'm not exactly bowled over by how long it's taken Apple, with all their resources, to rewrite Foundation.

Swift has its own standard library, so there wasn't much reason to do this. In particular, it would've made things slower to mix them until the implementation was very mature. Also, this project's been going for a few years I think, since it's used for Swift on Linux.

> Also, this project's been going for a few years I think, since it's used for Swift on Linux.

That doesn't seem accurate:

"The Foundation package is an independent project in its early incubation stages."

"In the future, we will explore how to sunset the existing swift-corelibs-foundation and migrate to using the new version of Foundation created by this project."

Re: Apple is rewriting Foundation in Swift

#56

I just... completely don't understand the appeal of Swift beyond it being Apple's in-house language. I was excited for Foundation to become open-source. Using a language you'll really only find in 1 environment is a negative. I'm going to go feel ashamed for not getting excited about a language now. I should be celebrating "more languages", but Swift is just Apple. No one outside Apple chooses Shift unless they want…

If they just had a proper cross platform standard library and package manager it might be more successful, it is a pretty cool language. But the north Korean esque closed apple ecosystem makes that impossible, all of that is intentional.

Re: Apple is rewriting Foundation in Swift

#57
post #55

Earlier quoted context omitted.

Swift has its own standard library, so there wasn't much reason to do this. In particular, it would've made things slower to mix them until the implementation was very mature. Also, this project's been going for a few years I think, since it's used for Swift on Linux.

> Also, this project's been going for a few years I think, since it's used for Swift on Linux. That doesn't seem accurate: "The Foundation package is an independent project in its early incubation stages." "In the future, we will explore how to sunset the existing swift-corelibs-foundation and migrate to using the new version of Foundation created by this project."

swift-corelibs-foundation is what I meant, it contains a portable implementation of Foundation. Don't remember which parts were in Swift though.

Re: Apple is rewriting Foundation in Swift

#59

I just... completely don't understand the appeal of Swift beyond it being Apple's in-house language. I was excited for Foundation to become open-source. Using a language you'll really only find in 1 environment is a negative. I'm going to go feel ashamed for not getting excited about a language now. I should be celebrating "more languages", but Swift is just Apple. No one outside Apple chooses Shift unless they want…

IBM briefly did a "swift on the server" though at the beginning of 2020 IBM was no longer interested, but the page is still up. https://developer.ibm.com/languages/swift/

2016: https://9to5mac.com/2016/02/22/ibm-swift-cloud-kitura/

2016: https://www.infoq.com/presentations/swift-server/

2020: https://www.infoq.com/news/2020/01/ibm-stop-work-swift-serve...

You can run it in docker: https://hub.docker.com/_/swift

Re: Apple is rewriting Foundation in Swift

#60

I just... completely don't understand the appeal of Swift beyond it being Apple's in-house language. I was excited for Foundation to become open-source. Using a language you'll really only find in 1 environment is a negative. I'm going to go feel ashamed for not getting excited about a language now. I should be celebrating "more languages", but Swift is just Apple. No one outside Apple chooses Shift unless they want…

If they just had a proper cross platform standard library and package manager it might be more successful, it is a pretty cool language. But the north Korean esque closed apple ecosystem makes that impossible, all of that is intentional.

The package manager has been open source, cross platform and available since pretty much from the start.

The standard library is becoming cross-platform as we discuss it here.

Post reply on HN