Live data from Hacker News

Apple is rewriting Foundation in Swift

github.com

41–50 of 263 posts

Re: Apple is rewriting Foundation in Swift

#41

Well, this is one more step toward a fully Swift-only platform. Very soon it will not be possible to publish an app on iOS not built with the house language. For those who don’t know, using C/C++ and opengl was easily done on iOS for many years, as llvm/clang was the official compiler.

Happily Swift has interop with C, and they're working on actual C++[1], which would be a lot of wasted effort.

The question is very simple: Swift is meant to be a safe language, how feasible is that if a large chunk of the core types and runtime are implemented in C, C++, and Objective-C/C++? Migrating to Swift is the obvious and sensible step, unless you propose re-implementing them in yet another language?

[1] https://github.com/apple/swift/blob/main/docs/CppInteroperab...

Re: Apple is rewriting Foundation in Swift

#42
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 to build something in Apple's ecosystem.

Re: Apple is rewriting Foundation in Swift

#43
post #29

Earlier quoted context omitted.

What a weird usage of that word…

GP was probably looking for the word "astroturfing": astroturfing: > The disguising of an orchestrated campaign as a "grass-roots" event – i.e., a spontaneous upwelling of public opinion. https://en.wiktionary.org/wiki/astroturfing agitprop: > Political propaganda disseminated through art, drama, literature, etc., especially communist propaganda; (specifically, communism, historical) such propaganda formerly dissemin…

Oh, it is astroturfing to be sure. But I was just having fun with the propaganda inherent in the sentence too.

Re: Apple is rewriting Foundation in Swift

#44

Well, this is one more step toward a fully Swift-only platform. Very soon it will not be possible to publish an app on iOS not built with the house language. For those who don’t know, using C/C++ and opengl was easily done on iOS for many years, as llvm/clang was the official compiler.

Bad take. Swift heavily relies on LLVM. As long as you have LLVM IR, your support isn’t going anywhere. Not to mention Apple continues to be an outsized contributor to LLVM and clang (largely because they started and open sourced the projects)

Apple only started Clang, llvm already existed - although for a very long time apple was the main contributor (I assume until clang became competitive with gcc no other companies were interested in clang or llvm, and once clang was competitive it meant llvm was able to be a competitive backend as well).

Re: Apple is rewriting Foundation in Swift

#45

What a dumpster fire Swift turned out to be. My first experience with it saw compile times go up more than 10x from the previous objc code base. Everytime more and more of apple's libraries were replaced because all the objc stuff was considered obsolete the compile times got worst and worst. Its not like I dislike the language either but I think compile times matter so languages should not pretend like that doesn't…

They both compile slowly because they have similarly complicated type systems. What do you use in Rust that Swift doesn’t yet provide?

You can have a good type system and have fast compile times. In every single language with 'complicated type systems' it always comes down to type inference on polymorphic types which causes these issues, this has been known for over 40 years yet the same issue seems to be rediscovered again and again like it was something new.

I sure hope the author learned the right lesson from the failure that is Swift and Mojo turns out to be better. I do not want a language with a complicated type system and long compile times. I want a 'good enough' type system and fast compile times.

Re: Apple is rewriting Foundation in Swift

#46

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…

As someone who mostly writes Go, I enjoy Swift the language. I am guessing that your concerns are centered on Swift the ecosystem? (E.g., it's only used for Apple things, so there are probably not libraries for Thing X.) If so that makes total sense to me. If not, I'd be interested to hear more.

Re: Apple is rewriting Foundation in Swift

#48
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.

Re: Apple is rewriting Foundation in Swift

#49

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…

There was a lot of excitement when it first came out.

I tried Swift for Linux, and soon realized it was a meh experience (NS this, NS that... NextStep is still there) and switched back to Rust.

It could have been a strong Rust alternative.

Re: Apple is rewriting Foundation in Swift

#50

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…

While generally true that you’re not gonna find swift anywhere else, this company[0] is making their browser cross platform and using swift as the language. Apparently there’s a proof of concept runtime for windows that they’re actively working on.

[0] https://arc.net/

Post reply on HN