Swift started supporting interoperability with C++ in Swift 5.9. We have gotten a significant amount of feedback both before and after Swift 5.9 got released, and we now think that we’re ready to start taking C++ interoperability through the Swift evolution process.
C++ interoperability is a large and complex language feature. As such, we can’t take the entire feature through the evolution process in one proposal. Because of that, we would like to take a piecewise approach to evolution of C++ interoperability. This way we can start by building on top of existing support for C / Objective-C interoperability, and subsequent evolution proposals can build on top of each other.
We put together a list of four initial proposals which we would like to take through evolution first:
- Using C++ classes and structures in Swift
- Using C++ methods and initializers in Swift
- Bridging Swift modules to C++ and Swift native functions to C
- Using sequential C++ containers in Swift
Let us know if you have any thoughts about this plan. I am planning to put out the initial version for the first proposal in the next two weeks.