what's new in 2025 in swift language interop with cpp
Asked on 06/16/2025
1 search
In 2025, Swift introduced several enhancements to its interoperability with C++ and other languages. One of the key updates in Swift 6.2 is the introduction of a feature called Strict Memory Safety, which requires explicit acknowledgment of unsafe API usage in source code. This feature helps developers identify parts of their code that need extra attention from a security perspective, especially when interoperating with C and C++.
Additionally, Swift 6.2 supports new annotations for C and C++ headers, allowing APIs to be imported into Swift using safe ergonomic types like Span. This provides a memory-safe interface that is easier to use, enhancing the safety and performance of Swift when interacting with C++ code.
For more detailed information on these interoperability features, you can refer to the session Safely mix C, C++, and Swift (00:02:18).

What’s new in Swift
Join us for an update on Swift. We’ll talk about workflow improvements that make you more productive, and new and modernized library APIs for fundamental programming tasks. We’ll show examples of Swift adoption throughout more layers of the software stack. Finally, we’ll explore new language features for both improving approachability of concurrency, and achieving peak performance when you need it.

Explore Swift and Java interoperability
Learn how you can mix Swift and Java in a single codebase. We’ll introduce the swift-java interoperability project, which allows you to use Swift in Java programs or vice versa. We’ll show you how to use the tools and libraries offered by swift-java to write safe and performant code that interoperates between these two runtimes.

Safely mix C, C++, and Swift
Learn how to mix C, C++, and Swift while improving the safety of your apps. We’ll show you how to find where unsafe C and C++ APIs are called in your Swift code, how to call them more safely, and how to make your app’s existing C and C++ code safer by default.