HackerTube
HomeLongsLikedHistoryWatch laterCategoriesPlaylistsSettings

Introducing a Memory-Safe Successor Language in Large C++ Code Bases - John McCall - CppNow 2023

CppNow3 HN recommenders · recommended in 3 months, 2023-2025
YouTube
18K views · 3 years ago · talk · dated

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.

Used as the primary source for Apple's stated plan to make Swift its successor to C++ and for how interop supports gradual transition.

C, C++, Rust, Go & systems languagesProgramming language designSecurity & hacking#swift#c++#memorysafety#languageinterop#apple

20 comments from Hacker News

@pjmlp2025 · in “Apple’s Darwin OS and XNU Kernel Deep Dive”

Yes, Apple themselves, apparently folks wanting Apple to use Rust don't read Apple's documentation or watch talks done by Apple compiler developers. > 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. -- link "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video "So we feel pretty strongly, obviously at Apple our sucessor language is Swift and I am here to talk about features of Swift, both to try to sell you on to it, but also to talk about the things we think are pretty necessary and the ways in which a programming language can support, you know, clear code, safer and more correct code." "Like I said before, Apple has always intended for Swift to be a sucessor language for all of our predecessors, from the top to the bottom of our stack, accessible to novices, powerful enough for experts, it is real a tall order. From ▶ this video to ▶ this video "Swift as C++ Successor in FoundationDB" link

CitesView on HN
@pornel2024 · in “Safe and efficient C++ interoperability via non-escapable types and lifetimes”

Apple wants to migrate away from C++, including code in the kernel, so they need a safe, low-overhead language. Swift has originally been designed as an ObjC replacement, mostly for UI glue code, with conveniences more like a scripting language. So now they're working on making Swift support more low-level low-overhead code. ▶ this video

CitesView on HN
@myko2024 · in “Swift 6”

John McCall (Swift team) gave a talk on Swift replacing C++ earlier this year: ▶ this video Selfishly I wish mixed C targets were a priority before C++ but I get why this was more important to them

CitesView on HN
@stephen_g2024 · in “Ladybird Web Browser becomes a non-profit with $1M from GitHub Founder”

I wonder if they are thinking Swift - their C++ interop is still pretty new and has a way to mature, but it’s designed for exactly this [1] (we should expect Apple to start doing it with WebKit and other big C++ projects, even perhaps LLVM). 1. ▶ this video

CitesView on HN
@glhaynes2024 · in “Swift Static Linux SDK”

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) ▶ this 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

RecommendsView on HN
@pjmlp2024 · in “The Case for Rust in the base system”

There are zero references to Rust on that talk. It is all about C, C++, Objective-C and how Apple is replacing them with Swift. Rust isn't even shown on languages in use at Apple, ▶ this video As for tracking down the exact minutes of each Swift reference, maybe I will try to find some time on my side to prove me right on the Internet.

CitesView on HN
@pjmlp2024 · in “The Case for Rust in the base system”

Apple's John McCall makes a picture of where they are going with Swift in "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video

CitesView on HN
@pjmlp2024 · in “The Case for Rust in the base system”

Apple's John McCall makes a picture of where they are going with Swift in "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video

CitesView on HN
@stephen_g2024 · in “Apple hiring compiler developers for improving Swift / C++ interoperability”

They definitely have opened some things up, like a full C++ interface to Metal. I think the idea with this current effort is kind of the opposite though - not to encourage more use of C++, but to start writing new features of C++ projects in Swift (the presenter at the C++ Now 2023 talk [1] goes into this). I expect WebKit is a big target for them, I think they eventually want to replace all their C++ with Swift gradually (instead of trying to do ground-up rewrites, where you dedicate a team to doing that for years and you have a replacement at the end with fewer features than the old project). 1. ▶ this video

CitesView on HN
@stephen_g2023 · in “Operation Triangulation: What you get when attack iPhones of researchers”

That is exactly their plan. Swift could always link into C applications, and they have recently come out with C++ interoperability [1] so things like WebKit etc. can start having parts re-written or new parts written from the start in Swift so they can gradually replace C and C++ codebases instead of trying to rewrite everything (which sucks because even for things much, much less complex than WebKit, you can have a team working for three years working on a replacement and it’ll have less features than the original had when you started). They’re even working on an embedded subset for embedded devices so things like microcontrollers like battery management, the Secure Enclave etc. can run it. 1. ▶ this video

CitesView on HN
@mannuch2023 · in “Memory safety is necessary, not sufficient”

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 ▶ this video Konrad Malawski at StrangeLoop 2023 link

RecommendsView on HN
@nrr2023 · in “Swift was always going to be part of the OS”

The raisons d'être between the CLR (and C#) and Swift are entirely different. Apple has explicitly set out to adopt Swift as a successor language to C, Objective-C, C++, and Objective-C++[0][1]. This stands in stark contrast to Microsoft's vision for the CLR, which was… to be a better Java, more or less? (Does anyone actually know what the .NET initiative was all about? Microsoft went absolutely ham on it in their branding, but the momentum unceremoniously fizzled out before Server 2003 went RTM.) That said, apropos .NET fitting into Windows, the work on Singularity[2] by MSR had a lasting impact. I'm told that there is in use a System C# dialect that generates native object code via a more production grade version of Bartok[3]. 0: ▶ this video 1: link . 2: link 3: link

CitesView on HN
@stephen_g2023 · in “Apple's use of Swift and SwiftUI in iOS 17”

In the recent talk about the new Swift to C++ bidirectional bridge [1] the presenter from Apple says that they intend to eventually use Swift for basically all their first-party code from embedded code on microcontrollers, to the kernel, libraries and apps. There will be language subsets for embedded and kernel development, not all features would be able to be used at the lower levels. 1. ▶ this video

CitesView on HN
@pjmlp2023 · in “Apple's use of Swift and SwiftUI in iOS 17”

On the same subject, some talks from Apple folks, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video "Swift as C++ Successor in FoundationDB" link

CitesView on HN
@pjmlp2023 · in “Bare-metal Rust in Android”

Apparently people keep forgetting Swift exists. "CppNow 2023:Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video

CitesView on HN
@stephen_g2023 · in “PostScript’s Sudden Death in Sonoma”

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 - ▶ this 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.

CitesView on HN
@pohl2023 · in “Interoperability: Swift’s Super Power”

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: ▶ this video

CitesView on HN
@pjmlp2023 · in “Interoperability: Swift’s Super Power”

On the same note, watch Apple's talk at CppCon 2023, "Introducing a Memory-Safe Successor Language in Large C++ Code Bases" ▶ this video

RecommendsView on HN
@pjmlp2023 · in “Show HN: C-ocoa, Write iOS/macOS apps in any language, with a generated C API”

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" ▶ this video

RecommendsView on HN
@pjmlp2023 · in “Show HN: C-ocoa, Write iOS/macOS apps in any language, with a generated C API”

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" ▶ this video

CitesView on HN
"Swift as C++ Successor in FoundationDB" by Konrad Malawski (Strange Loop 2023)42:24

"Swift as C++ Successor in FoundationDB" by Konrad Malawski (Strange Loop 2023)

Strange Loop Conference
20K views • 3 years ago
Carbon Language Successor Strategy: From C++ Interop to Memory Safety - Chandler Carruth - CppNow 231:38:57

Carbon Language Successor Strategy: From C++ Interop to Memory Safety - Chandler Carruth - CppNow 23

CppNow
24K views • 3 years ago
Interfacing D To Legacy C++ Code1:21:23

Interfacing D To Legacy C++ Code

NWCPP - Northwest C++ Users Group
5K views • 11 years ago
Going Native 2012 Keynote Stroustrup1:29:49

Going Native 2012 Keynote Stroustrup

savage309
33K views • 14 years ago
Can C++ be 10x Simpler & Safer?  - Herb Sutter - CppCon 20221:54:00

Can C++ be 10x Simpler & Safer? - Herb Sutter - CppCon 2022

CppCon
277K views • 3 years ago
Rust: A Language for the Next 40 Years - Carol Nichols55:08

Rust: A Language for the Next 40 Years - Carol Nichols

ChariotSolutions
367K views • 7 years ago
WWDC24: Go small with Embedded Swift | Apple22:17

WWDC24: Go small with Embedded Swift | Apple

Apple Developer
138K views • 2 years ago
Is It Time to Rewrite the Operating System in Rust?1:09:18

Is It Time to Rewrite the Operating System in Rust?

InfoQ
310K views • 7 years ago
Dconf 2014 Day 2 Keynote: The Last Thing D Needs -- Scott Meyers54:55

Dconf 2014 Day 2 Keynote: The Last Thing D Needs -- Scott Meyers

The D Language Foundation
19K views • 8 years ago
Google I/O 2012 - Meet the Go Team1:00:29

Google I/O 2012 - Meet the Go Team

Google for Developers
108K views • 14 years ago
Lang NEXT 2014 Panel  Systems Programming in 2014 and Beyond1:05:56

Lang NEXT 2014 Panel Systems Programming in 2014 and Beyond

25msr
3K views • 8 years ago
Ideas about a new programming language for games.1:55:24

Ideas about a new programming language for games.

Jonathan Blow
530K views • 12 years ago
CppCon 2015: Bjarne Stroustrup “Writing Good C++14”1:40:46

CppCon 2015: Bjarne Stroustrup “Writing Good C++14”

CppCon
351K views • 11 years ago
NVIDIA — Securing the Future of Safety and Security of Embedded Software (Captioned)58:37

NVIDIA — Securing the Future of Safety and Security of Embedded Software (Captioned)

AdaCore
5K views • 6 years ago
Swift for TensorFlow: The Next-Generation Machine Learning Framework (TF Dev Summit '19)31:22

Swift for TensorFlow: The Next-Generation Machine Learning Framework (TF Dev Summit '19)

TensorFlow
41K views • 7 years ago
Modern C and What We Can Learn From It - Luca Sas [ ACCU 2021 ]1:05:59

Modern C and What We Can Learn From It - Luca Sas [ ACCU 2021 ]

ACCU Conference
130K views • 5 years ago
Microsoft is Getting Rusty: A Review of Successes and Challenges - Mark Russinovich34:41

Microsoft is Getting Rusty: A Review of Successes and Challenges - Mark Russinovich

Rust Nation UK
46K views • 1 year ago
OSCON 2010:  Rob Pike, "Public Static Void"12:31

OSCON 2010: Rob Pike, "Public Static Void"

O'Reilly
119K views • 16 years ago
Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 20231:35:12

Modernizing Compiler Design for Carbon Toolchain - Chandler Carruth - CppNow 2023

CppNow
71K views • 3 years ago
CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”1:04:26

CppCon 2018: G. Nishanov “Nano-coroutines to the Rescue! (Using Coroutines TS, of Course)”

CppCon
40K views • 8 years ago