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

Strange Loop Conference3 HN recommenders · 2023–2025
20K views · talk · dated · Uploaded 2023-10-12

Konrad Malawski's Strange Loop 2023 talk shows how the FoundationDB team adopted Swift incrementally in a C++ codebase. It covers Swift's C++ interoperability, which let them move single functions or entire types over one at a time.

HN commenters recommend it as the main resource on Swift as an incremental successor to C++ and on how the interoperability works in practice.

Watch on YouTube

9 comments from Hacker News

@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" [LINK] "Swift as C++ Successor in FoundationDB" [VIDEO]

@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 [LINK] Konrad Malawski at StrangeLoop 2023 [VIDEO]

RecommendsView on HN
@sandyarmstrong2024 · in “9 years of Apple text editor solo dev”

Yup, exactly. Swift was specifically designed to replace Objective-C and C++ throughout Apple codebases (see [VIDEO] ). C# is a totally different story.

@frankjr2024 · in “Apple hiring compiler developers for improving Swift / C++ interoperability”

A lot of details on the interoperability also in the recent talk "Swift as C++ Successor in FoundationDB" at Strange Loop 2023. [VIDEO]

@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) [LINK] - "Swift as C++ Successor in FoundationDB" (Konrad Malawski; Strange Loop 2023) [VIDEO] 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
@cube22222024 · in “Ladybird browser to start using Swift language this fall”

Honestly, Swift seems like such a nice language. Most of the performance and power, great interop, but more directed at application development than Rust (with e.g. refcounting being the default). But as they say, you choose a language for its ecosystem, not for the language itself. It would be great if Swift’s open source ecosystem for stuff other than app development grew. It does indeed seem like Apple is pushing for it with stuff like Swift for embedded. The fairly recent presentation about starting to move FoundationDB to Swift[0] was also very interesting. A follow-up on that at some point would be quite interesting to see too, and would inspire confidence if the process is going well. Arc is also a nice example of a cross-platform app written in Swift, with their fairly recent addition of Windows support. Either way, fingers crossed, and very happy with TFA. PS: does anybody have experience with async/await in Swift? Is it pleasant to use? [0]: [VIDEO]

RecommendsView on HN
@Someone2024 · in “Swift 6”

> I’d be interested to know how good this integration is in practice I haven’t used it, but from looking at the long) video at [VIDEO] (discussed in [LINK] ), it looks pretty good.

@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" [LINK] "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 [LINK] to [LINK] "Swift as C++ Successor in FoundationDB" [VIDEO]

@pjmlp2025 · in “FoundationDB: From idea to Apple acquisition [video]”

Nowadays being rewritten into Swift. "Swift as C++ Successor in FoundationDB" by Konrad Malawski (Strange Loop 2023) [VIDEO]