-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Adopt swift-foundation #5001
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
The package branch is tracking this work. |
@parkera Which version of CoreFoundation is currently in |
Additionally, how different is this foundation from Darwin's Foundation.framework? |
This is essentially the same CF as was in swift-corelibs-foundation as before, with a bunch of minor edits. We just use a lot less of it because many functionalities around things like TimeZone, Calendar, Locale have been completely reimplemented in Swift, in swift-foundation. The C implementations here are left for compatibility with things we haven't replaced in C usage yet, primarily things like CFDateFormatter and the like. On Darwin we use Objective-C as a shim to call up from CoreFoundation to the new Swift implementations and this C code is completely deleted. We didn't have that option here, so it's more of a fork than before in that sense. One last thing - we don't intend for CoreFoundation to be an API for Swift apps on non-Darwin platforms. It's always been an implementation detail of swift-corelibs-foundation. We really want people to write code in Swift, not C, wherever possible. |
The README has some info on the project structure, what is shared with Darwin (the answer to that is the vast majority of swift-foundation), and what this project is now focused on. |
So this is based on Monterey CoreFoundation, then? And if I want a Ventura CoreFoundation, I should use the closed Ventura Merge PRs? Also, will Sonoma CoreFoundation and future CoreFoundations be published, or will Ventura CoreFoundation be the last CoreFoundation to be published?
So for ObjC applications on Darwin, both CoreFoundation and Foundation include wrappers to call swift-foundation for any APIs implemented by swift-foundation, and continue to use the old C/ObjC implementations for the rest?
Unfortunately, using the Swift API is not feasible for ObjC applications on non-Darwin platforms. I currently maintain a fork of Catalina CoreFoundation which toll-free bridges to GNUstep Base (a cross-platform Foundation implementation written in ObjC), and was planning to update it to Ventura CoreFoundation when I discovered that swift-corelibs-foundation was undergoing some pretty major changes. I understand that CoreFoundation is considered an implementation detail of swift-corelibs-foundation, but I was prepared to fix any issues out-of-tree so that I could support existing ObjC applications. |
@parkera Are the closed PRs for Ventura CoreFoundation the latest CoreFoundation I can use if I need it for a C or ObjC project? Additionally, will future CoreFoundations such as Sonoma and Sequoia be released? |
I think your best bet is to use the C code available here, or in an older tag here as we transition away from it. In truth the C code on Darwin is primarily being "updated" to delete it and replace it with more Swift. |
So I should probably stick to the Monterey code from before the adoption of swift-foundation? Since swift-foundation was not adopted yet in Ventura, why would I not want to use the Ventura CoreFoundation? |
If you want to work from one of the closed PRs, you can do that too - but it's not as likely to compile and work as the merged versions. |
Ok, thanks for your help! |
"Re-core" swift-corelibs-foundation on top of swift-foundation, and remove now-duplicated types from swift-corelibs-foundation.
This brings swift-corelibs-foundation up to date with the shared sources used in Darwin's Foundation.framework.
The text was updated successfully, but these errors were encountered: