Re:Swift and C++ interoperability workgroup announcement
by beached_whale on Tuesday February 01, 2022 @09:02AM
(#30162486)
I didn’t know even that was possible and thought that I had to use objc as it used to be. Nice
[ Parent
| on HN ]
Re:Swift and C++ interoperability workgroup announcement
by user-the-name on Tuesday February 01, 2022 @09:11AM
(#30162595)
Objective-C is a superset of C. If there is Objective-C interop, there is by necessity already C interop.
Re:Swift and C++ interoperability workgroup announcement
by gumby on Tuesday February 01, 2022 @10:04AM
(#30163378)
That is not completely true. There could be object round trip support between objective c and swift objects which would not be available through a C interface. Consider ObjectiveC++ as an example.
Re:Swift and C++ interoperability workgroup announcement
by jb1991 on Tuesday February 01, 2022 @10:48AM
(#30164064)
You are talking about something different, I think. Of course, if you need Objective-C features, you don’t get those from C. But if you simply need C features, you don’t need Objective-C just for that. In the context of a C api exposed over C++, objective C is not necessary.
Re:Swift and C++ interoperability workgroup announcement
by conradev on Tuesday February 01, 2022 @10:34AM
(#30163870)
You can also use this to wedge the C preprocessor into Swift
for example, I can inject variables into the C preprocessor in my build settings and have a C header that defines constant strings with those variables, which I can then import directly into Swift as a module