News for hackers. Stuff that matters.
Re:Swift and C++ interoperability workgroup announcement by ChubbyGlasses on Tuesday February 01, 2022 @10:34AM (#30163876)
This is really nice to see; apart from the weirdly named, macOS specific NS* apis, Swift has been a real pleasure to use and, refreshingly, feels like a language designed for humans first. I hope this means Swift has a chance to eat Rusts’ lunch :)

Does anyone know how c++ classes and struct will interact with ARC?

Re:Swift and C++ interoperability workgroup announcement by tarentel on Tuesday February 01, 2022 @11:15AM (#30164530)
> The biggest semantic impedance mismatch between C++ classes and Swift classes is that Swift classes are reference-counted. It is certainly possible to import a C++ class as a Swift class if it is intrusively reference counted, or wrapped in a shared_ptr.

> But what about non-movable C++ classes that are not reference counted? This issue could be worked around by making retain and release operations on C++ classes be a no-op, and introducing an explicit "delete" operation, effectively making C++ class references in Swift equivalent to UnsafeMutablePointer.

There's some information about it in https://github.com/apple/swift/blob/main/docs/CppInteroperab... this is quite long though so there's likely a lot more information. This quote is apparently just one strategy they're considering? At least that's my take on reading it.

Re:Swift and C++ interoperability workgroup announcement by lubesGordi on Tuesday February 01, 2022 @12:21PM (#30165848)
NS stands for NextStep.