Re:Interoperability: Swift’s Super Power
by w10-1 on Thursday September 21, 2023 @03:11AM
(#37594171)
A Swift package can have modules/targets that are C/C++. It delegates the module building to clang, and Swift can both read/use those modules and publish its own API for use from C/C++. In Swift the "unsafe" family of API's converts Swift objects to C/C++ pointers relatively ergonomically. Note that Swift 5 added a lot of features to support ABI stability.
https://www.swift.org/documentation/cxx-interop/