Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is that an up-to-date critique? Because iOS 17/MacOS Sonoma have the rewritten JSON decoder:

> The code in our GitHub repository 20 has indeed shipped as part of iOS 17 and macOS Sonoma. That includes our new, dramatically faster implementations of JSONDecoder and Calendar.

https://forums.swift.org/t/any-updates-on-the-new-foundation...

That comment was from Nov 2023, and if you look at the GitHub repo, you’ll see that the JSON part of Foundation has commits within even the last month (perhaps getting ready for Swift 6.0?).



Correct. Swift doesn't have any concept of JSON in its standard library; JSON[Encoder|Decoder] are provided by the Foundation framework, which (until Sonoma/iOS 17) used an Objective-C implementation of NSJSONSerialization.


Didn't know this shipped in ios 17. The comment mentions "JSONDecoder", do you know if it's only the decoder, or the encoder too ?

Problem with iOS is this constant need for objc compatibility and transparent bridging, which really messes things up a lot..


Newer libraries tend to be written to use Swift value types rather than classes, avoiding the bridging penalties you mentioned.


Both.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: