The Foundation framework is the core of Apple’s macOS and iOS basic component support. Almost all Swift projects use the Foundation framework. It mainly contains a large number of commonly used APIs, providing a basic layer for many basic functions and laying the foundation for writing excellent Swift code. foundation.

The swift-corelibs-foundation project helped launch the open source Swift version of Foundation in 2016, but they wrapped the Swift layer in Foundation’s existing open source C implementation.

With the development of Swift in terms of technology (such as ABI stability) over the years, Swift has begun to re-evaluate the open source Foundation’s strategy. Therefore, they announced that they would rewrite the Foundation framework in pure Swift and open source it.

When Swift started as an open source project, we wanted to open up not just the language itself, but the ecosystem that goes with it. Foundation has been instrumental in its drive to grow the Swift language and has been an integral part of the Swift developer experience from day one, and we knew it had to be included in open source offerings.

To this end, Foundation, rewritten in pure Swift and open-sourced, will achieve the following series of technical goals:

  • With Foundation’s native Swift implementation, the framework no longer bears the cost of switching between C and Swift, resulting in faster performance. Being a Swift implementation developed as a package also makes it easier for Swift developers to inspect, understand and contribute code.
  • Choice of smaller, more granular packages: Rewriting Foundation provided an opportunity to match its architecture to changing use cases.
  • Unified Foundation implementations: When moving code across platforms, multiple implementations of any API can lead to different behavior and ultimately bugs. This new Foundation package will serve as the core of a single, canonical implementation of Foundation, regardless of platform.

According to the announcement, this new Foundation framework will be open-sourced and released on GitHub in 2023.

#Swift #Foundation #framework #rewritten #Swift #open #sourced #News Fast Delivery

Leave a Comment

Your email address will not be published. Required fields are marked *