Live data from Hacker News

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

infoq.com

211–220 of 402 posts

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

#211
post #185

Is there anything genuinely innovative about Swift or is it just another "cross-platform scripting language" that I'll only see on 1 platform? The only reason I learned Powershell is because I have to admin for Windows. At least Powershell is interesting for its pipeline and object handling. I get not one spark of joy from Swift, and the comments I see are "at least we're not writing C anymore". Stockholm syndrome. S…

If I recall Swift has a very interesting ABI for generics. 1. https://faultlore.com/blah/swift-abi/

I appreciated this comment. This is something I hadn't seen :-)

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

#212
post #139

Earlier quoted context omitted.

Yes, but that's OUR surveillance and we're cool with that

Id rather be spied on by foreigners who couldn't do anything about my eccentricities even if they cared. When you're own government's security services are spying on you, they own you.

The options weren't foreign government or local government, the current state is both, the future is local only. It's clearly an improvement.

These security exploits also get used by local police who wouldn't have access to the top government access used for terrorists.

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

#213

This is an other step in the direction to a Swift-only Apple platforms. I don't think it would be worth my time to even buy a other macOS device to port my framework. I don't think they will get any benefit from this.

It's a good question as to how long Apple will support calling its APIs from C++ via Objective-C++. I don't see any good reason for them to deprecate the ObjC-Swift bridge, but I guess they could decide it's too much work to maintain.

Objective-C was/is an awful programming language, one of the worst I ever had the displeasure to work with.

But at least they relied on the LLVM toolchain and the NeXTStep heritage, it was possible to use clang and many C APIs and a few wrappers around the horrible Obj-C APIs.

With Swift I don't think this will be as practical, if even possible.

They are so rich and powerful that they don't care. And most devs on their platforms are happy to drink the kool-aid.

This will take time, because they have relatively strong foundations and deep pockets, but they are going to slowly sink their ship, what they are building these days is technically unsound and pretty soon their engineering culture will have completely changed.

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

#214

Earlier quoted context omitted.

Id rather be spied on by foreigners who couldn't do anything about my eccentricities even if they cared. When you're own government's security services are spying on you, they own you.

The options weren't foreign government or local government, the current state is both, the future is local only. It's clearly an improvement. These security exploits also get used by local police who wouldn't have access to the top government access used for terrorists.

[deleted]

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

#215

Earlier quoted context omitted.

What is the value provided by inheritance? It was my understanding that this was deliberately excluded from Rust as it's now seen as a bit of an anti pattern mostly inferior to traits.

Inheritance is about providing business logic in all downstream inheritors through a super() chain. If you want shared logic in Rust between several implementors of a trait you will probably end up with duplicate code. There are drawbacks to both.

You can solve duplication with macros to implement traits. The Rust way seems to provide the same convenience without the runtime costs.

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

#216

The removal of C from Android and iOS is going to pay off massively. The current state of things where every government is sitting on an endless collection of exploits is not ideal.

Interesting. I didn't realize C was so easy to exploit (I am a novice). Very interesting implications for security. Thanks for the cool insight.

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

#217
post #18

Todd, you owe me $20. (Todd said this would never happen) Also, this is great news, and it will be interesting to see what kind of real-world changes in performance this has.

I really should have started using Long Bets years ago. Ten years ago a “Tanya” told me she would never use an ebook to read literature. I’m pretty sure if I went to her house today I’d find 2. In fact I may be the only person I know who doesn’t own one (not wanting one and being fundamentally against them are two different things). That’s the most memorable but I’ve had these sorts of “over my dead body” conversatio…

I'm confused by the idea of searching someone's house for ebooks. Does that include PDFs?

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

#218
Tangental question: How do you Swift-using, non-app developers find out how to do basic anything non-app related, such as reading files and making network connections?

I Google for stuff and probably 3/4s of the result are out of date and won't work in any reasonably modern version of Swift. I find Apple's Developer documentation sub-par, to say the least. So, how do you navigate it all?

It's quite a shock coming from stuff like Go, C#, and Rust.

It'd be pretty cool if there were a good version of the Swift Cookbook Ala the classic Perl Cookbook.

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

#219

Earlier quoted context omitted.

Available data so far seems to show that the pure Swift implementations are faster than the Objective-C ones even when called from ObjC clients. I don't have a link, so feel free to treat as hearsay, but FYI.

You don't have a link to the data because this is not true. Swift is generally slower than Objective-C, often significantly so. There are cases where it is faster, but those are rare. Yes, I have measured. One example is JSON and Swift codable, which is comically slow, see: Somewhat Less Lethargic JSON Support for iOS/macOS, Part 1: The Status Quo https://blog.metaobject.com/2020/04/somewhat-less-lethargic-... Punch…

This largely depends on how much of SwiftObjC bridging you'll hit, as such it'll get faster if more of Foundation is converted to Swift.

In particular Swift is more memory efficient than ObjC because there's less boxing overhead to small values. That should matter more than the overhead from more overflow checking.

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

#220

Earlier quoted context omitted.

Id rather be spied on by foreigners who couldn't do anything about my eccentricities even if they cared. When you're own government's security services are spying on you, they own you.

The options weren't foreign government or local government, the current state is both, the future is local only. It's clearly an improvement. These security exploits also get used by local police who wouldn't have access to the top government access used for terrorists.

[deleted]
Post reply on HN