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).