3 ms·
> Swift can interface with C++? I've just done some googling but I cannot find any documentation at all relating to C++ interop. It is not there yet but it is
by rvz 6y ago
> Swift can interface with C++? I've just done some googling but I cannot find any documentation at all relating to C++ interop.
It is not there yet but it is actually being implemented on a native level. A quick Google gave me this. [0] [1] [2]
The approach is first-party than what you get with Rust's third-party crates and tools like bindgen, cxx, etc. Swift's C-interop approach is built-in and much more seamless and automated than bindgen's toggles and switches and creating them by hand in with cgo in Golang.
[0] https://github.com/apple/swift/blob/master/docs/CppInteroperabilityManifesto.md https://github.com/apple/swift/blob/master/docs/CppInteroper...
[1] https://github.com/apple/swift/pulls?q=label%3A%22C%2B%2B+Interop%22 https://github.com/apple/swift/pulls?q=label%3A%22C%2B%2B+In...
[2] https://forums.swift.org/t/manifesto-interoperability-between-swift-and-c/33874 https://forums.swift.org/t/manifesto-interoperability-betwee...
- saagarjha 6y agoIt's being worked on, but it's nowhere near being usable in any sense. Very fundamental things still need to be tied down and decided, much less implemented.
- rvz 6y agoWell I did say it's 'not there yet' and it is 'being implemented' so of course it is not yet usable as of now. Your same point could be said about Dart C/C++ FFI, Rust async-await, etc. The parent comment I replied to said: "...I cannot find any documentation at all relating to C++ interop." and this some kind of "documentation" that is related to 'C++ interop'.