I think some good terminology (that we can bike shed) is: Forward Interop for Swift consuming C++ APIs, Reverse/Backwards Interop for C++ consuming Swift APIs, and Bidirectional Interop when talking about both. (Because, when you're moving to Swift, you're moving forward )
IMO that would be harder to remember and no easier to say/write than simply "importing C++ [into Swift]" and "importing Swift [into C++]." Where the bracketed parts are optional in this context.
But that doesn't cover everything because you have two kinds of bridging for each kind of import. Calling a C++ function auto f(A) -> B from Swift involves bridging in both directions. I suggest
^ Same. This is great and I love what this could mean. Being able to directly interface with the swift standard library is a must-have and this achieves that so perfectly. Yes, I would love to be in the workgroup.
C++ interop has been implemented by extending the existing ClangImporter so far, hasn't it?
However, the current ClangImporter has potentially bugs because it is designed as a singleton.
I hope there would be some plans to split it into several classes to reduce such bugs, since there is an abstract class named ClangModuleLoader.
I work at Meta in the React Native team and we are pretty interested in the Swift/C++ interop. From here I can see that the project is progressing and it is in a good spot.
I'd like to contribute to the project and I wanted to ask a few questions:
Does the project have an ETA for when it would be officially released, out of the experimental stage?
Is there anything we can do to help developing it further and move toward a production-ready state?
Riccardo, we (myself, Daniel Rodriguez and others) are actively working on C++-Interop at Meta ; we are always looking for more folks to work with on our end . Issues are tagged here (I have filed a few):
Use the "C++-Interop" label manually. The Discourse Forums seems to reformat the URL and break the link when I paste it here.
I'd like to contribute to the project and I wanted to ask a few questions:
Awesome! I will add you to the workgroup.
Does the project have an ETA for when it would be officially released, out of the experimental stage?
Not at the moment.
Is there anything we can do to help developing it further and move toward a production-ready state?
Absolutely! Before we dive into details to see what you could help with, it would be helpful to understand which use case you are most interested in, using Swift APIs from C++, or using C++ APIs from Swift, or both?
Absolutely! Before we dive into details to see what you could help with, it would be helpful to understand which use case you are most interested in, using Swift APIs from C++, or using C++ APIs from Swift, or both?
I think that it will be both ways, actually. We have the engine written in C++ and it is now invoked by Java/Kotlin on Android and Objective-C++ on iOS. The engine can also invokes some delegates from the application code, so it could have to import some Swift files.
However, I believe that most of the interactions will require Swift to import some C++.
Great, that sounds good. There are definitely things we would appreciate help with on the forward side (using C++ from Swift), including helping with implementation, design, and also testing and adoption of features. It would definitely be good to get a new perspective from another adopter to see what the adoption experience is like, so that's probably the area you could help with the most.