4 ms·
Very difficult to do that in practice, because there’s currently no way to bridge C++ directly to Swift. You could bridge it via C, but any reasonable implement
by KerrAvon 4y ago
Very difficult to do that in practice, because there’s currently no way to bridge C++ directly to Swift. You could bridge it via C, but any reasonable implementation would have to severely limit the amount of direct Swift interaction with the core code, or you’d be spending infinite time maintaining the bridge.
- omar0226 4y agoActually C++ could be bridged thru Objective-C++ which at the same time can be bridged to Swift. A little bit manual, but possible
- avitzur 4y agoYes, precisely. I looked into bridging to C++ initially, but it was impractical.
- boulos 4y agoWas it in C++ originally not C? (It seems like a C FFI bridge would have been straightforward from). Or did it already go from C => Objective-C++ a while back? (I read the article hours ago and didn't notice you'd posted. Btw, I think we would have gotten better conversation if you had said "Hey, this is me! AMA" as a top-level comment)
- avitzur 4y agoIt has been in continuous development since 1985. Before the port, parts were in C, C++, Objective-C, and Objective-C++, as well as Lex, Yacc, GLSL, and Python. Will do the top-level comment.
- danappelxx 4y agoThere’s partial support which is under active development. https://github.com/apple/swift/tree/main/docs/CppInteroperability https://github.com/apple/swift/tree/main/docs/CppInteroperab... https://forums.swift.org/t/swift-and-c-interoperability-workgroup-announcement/54998 https://forums.swift.org/t/swift-and-c-interoperability-work...
- aaaaaaaaaaab 4y ago>You could bridge it via C *Objective-C++