
Introducing a Memory-Safe Successor Language in Large C++ Code Bases - John McCall - CppNow 2023
About this video
John McCall of Apple's Swift team presents at CppNow 2023 on introducing a memory-safe successor language into large C++ code bases. He argues incremental improvement of C++ hits hard limits and explains Swift's C++ interoperability for gradual migration.
Why it appears in the archive
Used as the primary source for Apple's stated plan to make Swift its successor to C++ and for how interop supports gradual transition.
AI-generated summary and labels from the source dataset; verify important details against the video. Source & credits.
From the Hacker News discussion
Java also compiles to native code on Android. Try to write an iOS application using only C and C++, instead of either Objective-C or Swift. "Swift was designed from the outset to be safer than C-based languages, and eliminates entire classes of unsafe code" -- [LINK] "Swift is a successor to the C, C++, and Objective-C languages. It includes low-level primitives such as types, flow control, and operators. It also provides object-oriented features such as classes, protocols, and generics, giving Cocoa and Cocoa Touch developers the performance and power they demand." -- [LINK] Some of the information related their Safe C dialect, [LINK] "2023 EuroLLVM - Keynote: “-fbounds-safety”: Enforcing bounds safety for production C code" [LINK] Finaly a recent gem from CppNow 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" [VIDEO]
Read original comment ↗On the same note, watch Apple's talk at CppCon 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" [VIDEO]
Read original comment ↗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 [VIDEO] Konrad Malawski at StrangeLoop 2023 [LINK]
Read original comment ↗I'm not a (direct) user of the C++ interop, but everything I've heard about it has been quite positive. A few hopefully relevant resources, first a couple of videos: - "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" (John McCall; CppNow 2023) [VIDEO] - "Swift as C++ Successor in FoundationDB" (Konrad Malawski; Strange Loop 2023) [LINK] And then a series of blog posts by Doug Gregor: - "Swift for C++ Practitioners" [LINK] And finally: - "Mixing Swift and C++" (Swift.org) [LINK]
Read original comment ↗As mentioned on the Swift talk at CppNow 2023, most of the C bindings are actually C++ with extern "C", and Apple would rather write less of them than more of. "CppNow 2023:Introducing a Memory-Safe Successor Language in Large C++ Code Bases" [VIDEO]
Read original comment ↗Don’t forget that this interoperability was put in place to support a specific engineering goal: to make it possible to slowly (over decades, probably) transition from 4 different languages (C, ObjC, C++, ObjC++) at every level of Apple’s stack towards a single successor language. Would you recommend they wait for some weird Java-esque 100% Pure implementation within the compiler itself before they can begin that work? The ideal you’re suggesting is actually made more possible by this work. One can imagine a Swift LLVM/Clang now. See: [VIDEO]
Read original comment ↗Apple have chosen to go all in on Swift for their first-party code, from the kernel to the libraries to the apps. Even things running on microcontrollers (but there’s no official or standard embedded Swift subset yet). It’s quite interesting actually that they’ve very intentionally focused on building transition layers so they can start gradually integrating Swift into C, Objective-C, and recently new support for C++ and Objective-C++. See this talk for the details on that - [VIDEO] So don’t expect to see any Rust code from Apple, although of course they might ship third party things written in it at some point.
Read original comment ↗Apparently people keep forgetting Swift exists. "CppNow 2023:Introducing a Memory-Safe Successor Language in Large C++ Code Bases" [VIDEO]
Read original comment ↗