Swift Foundation Unification

submited by
Style Pass
2024-10-14 21:30:04

The keynote from Tony [Parker] and me at ServerSideSwift2024 is up. Hear about how Swift interoperability allowed Foundation to make the switch to Swift, and about the latest direction for interoperability: from Swift to Java.

Apple has rewritten Foundation in Swift, and the Objective-C Foundation and Core Foundation now call into the Swift implementation. This improves performance from Swift, as there are fewer conversions, and also generally, as the Swift code has in some cases been optimized to reduce allocations.

The actual Foundation running on Apple’s platforms is now open source! They are working on a simpler review process for minor API proposals and encouraging more proposals from new contributors.

When I was getting started with Cocoa, Apple had just written an Objective-C to Java bridge. Apple emphasized that you could write native apps in Java This was seemingly rarely done, and I opted to use Objective-C even though I had been a Java programmer. I did use the Java bridge to call into a Java library that didn’t have an Objective-C equivalent. It worked well.

Anyway, there’s now a prototype bridge between Swift and Java. There are code generation tools to make it easier to call in both directions.

Leave a Comment