Doubt regarding C++ and Swift Interoperability (GSoC 23)

Hi !
I wanted to know whether the aim of this project is to create a bridging header that exposes the C++ functions and types one would want to use in Swift, or am I getting the wrong idea?
(New here)

Not quite: the idea is to expand the existing module that augments some types from the C++ standard library. This module is implemented in Swift and we call it the overlay.

Here is the source code of the overlay: swift/stdlib/public/Cxx at main · apple/swift · GitHub
For instance, the overlay provides a way to convert a std::string to a Swift.String: swift/String.swift at a8e32837506f98878aabad9aceb3fd173ef238a7 · apple/swift · GitHub
Note that this functionality is implemented in Swift, as a Swift extension for the C++ type std::string.

1 Like