4 ms·
I wonder what the author thinks about Swift’s new C++ interop story? Since the Swift compiler includes Clang, and can thus compile both your C++ and Swift into
by mannuch 3y ago
I wonder what the author thinks about Swift’s new C++ interop story? Since the Swift compiler includes Clang, and can thus compile both your C++ and Swift into LLVM IR, without the need for an FFI later between the two, couldn’t this be the “Typescript for C++” that the author points out a space for? The Swift folks are very much thinking about Swift as a C++ successor that can be incrementally migrated to so I’m a bit surprised the author didn’t discuss it further — especially given Swift’s spiritual similarities to Rust.
There’s a couple great talks on this by folks on the Swift team.
John McCall at CppNow
https://m.youtube.com/watch?v=lgivCGdmFrw https://m.youtube.com/watch?v=lgivCGdmFrw
Konrad Malawski at StrangeLoop 2023
https://m.youtube.com/watch?v=ZQc9-seU-5k https://m.youtube.com/watch?v=ZQc9-seU-5k
- steveklabnik 3y agoI do not know a ton about it. Thanks for the pointers. I kept up with Swift more in the old days, but it doesn't seem to have gained a ton of relevance outside of Apple platforms, which I don't develop for. Doesn't mean that I think that it's bad, just that that's why I haven't spent a lot of time with it yet.
- mannuch 3y agoFor sure! Yeah I think a lot of people don’t realize that there’s actually a ton of really interesting work going on in Swift that is very relevant to the current conversation around languages these days (i.e. memory safety, data race safety, performance, development experience, etc.) The cross-platform story is getting quite good with Swift, but I think a lot of people just aren’t aware of it. Linux support is good and Windows is getting better and better. For example, The Browser Company is betting big on using Swift for its Windows app and talks about why they are doing it https://open.substack.com/pub/speakinginswift/p/interoperability-swifts-super-power?utm_campaign=post&utm_medium=web https://open.substack.com/pub/speakinginswift/p/interoperabi...
- humanrebar 3y agoSwift is an interesting option, though that interop requires dropping support for non-clang toolchains, and I don't see that happening any time soon. I mean, it makes sense for code that exclusively targets Apple platforms, and maybe that's all that Apple and the Swift team care about?