catatp.fm Unofficial Accidental Tech Podcast transcripts (generated by computer, so expect errors).

ATP Interview: Holly Borla & Ben Cohen

In this special episode from the Apple podcast studio at WWDC 2024, we interview Swift Core Team members Holly Borla and Ben Cohen.

Episode Description:
  • Holly Borla: Swift Language Engineering Manager
  • Ben Cohen: Senior Software Engineering Manager, Swift Team

Transcribed using Whisper large_v2 (transcription) + WAV2VEC2_ASR_LARGE_LV60K_960H (alignment) + Pyannote (speaker diaritization).

Transcript start

⏹️ ▶️ Casey All right, how are we starting this? You’re starting it. I’m starting it. OK. You’re the host, man. All right. Well, here we go.

⏹️ ▶️ Casey All right. So, hey, everybody. We’re doing something extremely special today,

⏹️ ▶️ Casey and I am genuinely exceedingly excited about it. And so I teased last episode

⏹️ ▶️ Casey that we would have a little surprise coming up. And a little treat is, I think, what I called it. And it’s actually more than a little treat. It’s a big treat.

⏹️ ▶️ Casey So today we have a special guest, but not one special guest. We have two special

⏹️ ▶️ Casey guests. So here we have today Ben Cohen, who is Senior Software Engineering Manager for

⏹️ ▶️ Casey the Swift team, and Holly Borla, the Swift Language Engineering Manager. We are in the presence

⏹️ ▶️ Casey of greatness, and I don’t know how we ended up here, but I’m happy about it. So thank you, Ben

⏹️ ▶️ Casey and Holly, for being here. I know I speak for all three of us in saying we are extremely excited and lucky. So thank you. Thank

⏹️ ▶️ Casey you very much for having us on. Of

⏹️ ▶️ Ben Cohen course. I do interviewees very often, so it’s an honor.

⏹️ ▶️ Casey And actually, just this morning I was watching your video, which was very good, and we’ll talk about that. But I guess, Holly, if you don’t mind, if

⏹️ ▶️ Casey you wouldn’t mind starting, would you give me the nickel tour of who you are and what you do? I mean, I

⏹️ ▶️ Casey know, but not everyone knows. So who are you and what do you do for Apple?

⏹️ ▶️ Holly Borla Sure. Yeah. My name’s Holly. I’m the engineering manager of the Swift language team, like

⏹️ ▶️ Holly Borla you just said. My team focuses a lot on the user-facing language features like

⏹️ ▶️ Holly Borla the generic system, type inference, and this year our major focus has been the concurrency model and

⏹️ ▶️ Holly Borla specifically data rate safety in Swift 6. Before I joined the Swift team, I was a Swift programmer

⏹️ ▶️ Holly Borla working on Xcode, and before that I was a computer science student at the University of Michigan.

⏹️ ▶️ Casey That’s

⏹️ ▶️ Ben Cohen incredible. And Ben? Yeah, so my name is Ben Kern, and I manage the Swift team overall. So

⏹️ ▶️ Ben Cohen that includes the language, but also the backend, the optimizer, a lot of the tooling that goes around the

⏹️ ▶️ Ben Cohen language, like code completion and things like that. I’ve been at Apple about eight years. I’ve

⏹️ ▶️ Ben Cohen worked on various parts of the Swift compiler, including the standard library, the optimizer. Before

⏹️ ▶️ Ben Cohen that, I was not a compiler engineer. So I was actually working in FinTech type stuff.

⏹️ ▶️ Casey So I’m going to really make John happy. I’m going to jump

⏹️ ▶️ Casey, John right to the end.

⏹️ ▶️ Casey, Ben Cohen So I can’t

⏹️ ▶️ Casey follow up. We’re not

⏹️ ▶️ Casey, Ben Cohen doing follow up then, is that? No, we’re not doing follow up this time.

⏹️ ▶️ Casey Well, I guess a real time follow up. How did you end up, and I’m asking both of you, but Ben, since you most recently spoke, we’ll

⏹️ ▶️ Casey start with you. How do you end up being a compiler engineer? Because my perspective as a Swift developer is

⏹️ ▶️ Casey there’s people like me who kind of know what we’re doing. And then there’s compiler engineers who really know

⏹️ ▶️ Casey, John what they’re doing. It’s

⏹️ ▶️ John like a priesthood where you’re a programmer and you write the thing. And then if there’s something wrong with the compiler, you’re like, oh, it’s not

⏹️ ▶️ John my fault. There are people in an ivory tower somewhere that make this work. And

⏹️ ▶️ John they’re crossing over that path. I know there’s lots of advertising for job positions that you don’t need compiler experience.

⏹️ ▶️ John Just come be on the team. We’ll teach you.

⏹️ ▶️ Ben Cohen Well, that is true. You do not need compiler experience. And in fact, I think actually neither me nor Holly had

⏹️ ▶️ Ben Cohen direct compiler experience before joining the Swift team to work on the language. Do you have

⏹️ ▶️ Ben Cohen a high tolerance for

⏹️ ▶️ Marco pain?

⏹️ ▶️ Ben Cohen So actually, I came to Swift through pain from other languages.

⏹️ ▶️ Ben Cohen, Casey That

⏹️ ▶️ Casey is such a good

⏹️ ▶️ Ben Cohen, Casey answer. That is so good.

⏹️ ▶️ Ben Cohen My love. You sure you’re not in PR? So my love for Swift comes from the fact that

⏹️ ▶️ Ben Cohen I have experienced what other languages have to offer. And I’ve always been a language enthusiast.

⏹️ ▶️ Ben Cohen And so whether it’s Java or C++ or higher

⏹️ ▶️ Ben Cohen level languages like Ruby or Perl, there’s something great about all of these different languages. But

⏹️ ▶️ Ben Cohen I always felt historically, like, these languages had compromises. They were either a little bit too slow because

⏹️ ▶️ Ben Cohen they were more dynamic and scripting-based, or they were unsafe, like C++, or really hard

⏹️ ▶️ Ben Cohen to comprehend, like C++. It’s a true story. And my

⏹️ ▶️ Ben Cohen background is actually, I used to work on trading systems, and performance is really important

⏹️ ▶️ Ben Cohen in trading systems. And so we used to do a lot of things in C++, but at the same

⏹️ ▶️ Ben Cohen time, to be important in a trading system because you do not want the machine to do the wrong thing.

⏹️ ▶️ Ben Cohen And so we always used to have this trade-off between like C++ and Java. And

⏹️ ▶️ Ben Cohen when I saw Swift 10 years ago now, I was actually blown away by the fact that it

⏹️ ▶️ Ben Cohen actually managed to find the sweet spot between those different things. It was deterministic, it didn’t have a garbage

⏹️ ▶️ Ben Cohen collector, but also it had that like higher level feel. It does sometimes look a lot more like

⏹️ ▶️ Ben Cohen sort of the Ruby-like language

⏹️ ▶️ Ben Cohen that realized in things like Swift UI, where it’s like, brings back that joy of programming that I think sometimes we lose a little bit.

⏹️ ▶️ Ben Cohen And so that was what brought me to Swift. And I joined Apple originally. I was actually a library developer.

⏹️ ▶️ Ben Cohen So I didn’t have that background in compilers, but I did have that background in writing algorithms and data structures and things

⏹️ ▶️ Ben Cohen like that. And that was a really nice route in. And from that, I learned about compiler performance. And from that,

⏹️ ▶️ Ben Cohen got more into the general language design. And that’s how I ended up here.

⏹️ ▶️ Casey And then, Holly, you said you started working in Xcode. Is that right? and then kind of meandered from there? What was that story like?

⏹️ ▶️ Holly Borla Yeah, that’s right. So I actually signed up for a mentorship program that the Developer Tools

⏹️ ▶️ Holly Borla organization offered. And they deliberately paired mentees

⏹️ ▶️ Holly Borla up with mentors from different parts of the organization so that you could get to meet people who you didn’t

⏹️ ▶️ Holly Borla work with on a day-to-day basis. And I got paired up with a Swift compiler engineer. And that sort of sparked

⏹️ ▶️ Holly Borla my interest in actually joining the team. So for me, I feel like I became a compiler

⏹️ ▶️ Holly Borla engineer by accident. What brought me to Developer Tools at Apple is I was really interested

⏹️ ▶️ Holly Borla in education for programming. I also ended up studying computer science sort of by accident. I

⏹️ ▶️ Holly Borla didn’t go into university knowing anything about programming or computer science. Like a

⏹️ ▶️ Holly Borla decade ago today, you know, it’s Swift’s 10-year anniversary. Ten years ago, I knew nothing about programming. I

⏹️ ▶️ Holly Borla was graduating high school, set to study dance

⏹️ ▶️ Holly Borla at the University of Michigan and engineering was sort of my backup and all engineers have

⏹️ ▶️ Holly Borla to take a programming class and I really enjoyed it. And that, I think,

⏹️ ▶️ Holly Borla for me, really showed the power of making programming more approachable

⏹️ ▶️ Holly Borla to people who weren’t exposed to that previously. So I thought

⏹️ ▶️ Holly Borla working on developer tools was a good way to do that. And that was how I started to learn Swift

⏹️ ▶️ Holly Borla when I joined the Xcode team. the part of Xcode that I worked on had just been

⏹️ ▶️ Holly Borla entirely rewritten in Swift. So, yeah, it was this series of opportunities that

⏹️ ▶️ Holly Borla led me to really becoming interested in working on the Swift language itself. And now this is sort of the

⏹️ ▶️ Holly Borla ultimate opportunity to make programming more approachable to people who

⏹️ ▶️ Holly Borla have an idea and are interested in bringing that to life through code.

⏹️ ▶️ Casey I love that. And I’ll throw Marco under the bus with me, because I can tell you that Marco and I went to school

⏹️ ▶️ Casey for CS and computer engineering. And I cannot fathom a situation where engineering is like my

⏹️ ▶️ Casey fallback. Like, oh, I’m sure I’ll be fine in engineering if this other stuff doesn’t work. That’s incredible.

⏹️ ▶️ Marco I just couldn’t dance. That was my reason. That

⏹️ ▶️ John was all too. I think of her story as like an after-school special of how you can slip a slope into the seedy world

⏹️ ▶️ John of compiler engineering. She started out as a promising dancer, but somehow the compiler people got her.

⏹️ ▶️ John And now look at her.

⏹️ ▶️ Casey Now, I’m going to continue to make John upset by continuing to be at the bottom of the document. but I promise John, I will come back

⏹️ ▶️ Casey up to the beginning.

⏹️ ▶️ Marco At least you’re in the, I’m about to ask him if he’s not even in the documents.

⏹️ ▶️ Marco, Casey Well, there’s

⏹️ ▶️ Marco that. You’re doing great. We have a structure, we’re

⏹️ ▶️ John sticking to it.

⏹️ ▶️ Casey Are we? Well, this is

⏹️ ▶️ Casey, Marco our

⏹️ ▶️ Casey structure, despite what John says.

⏹️ ▶️ Marco It’s not copyable. John, have you heard the show?

⏹️ ▶️ Casey Right, so Ben, you were very rightfully, in my opinion, slagging on

⏹️ ▶️ Casey C++ just a few minutes ago, but

⏹️ ▶️ Casey, John last I heard-

⏹️ ▶️ John Guess what the Swift compiler is mostly right

⏹️ ▶️ John, Casey for? Well, that’s exactly what I was gonna

⏹️ ▶️ Casey say. So last I remember hearing, the Swift compiler, the last I looked, the Swift compiler is largely, if not entirely,

⏹️ ▶️ Casey C++. So you’re pointing at me, wait, there’s more. So tell me, is there

⏹️ ▶️ Casey more?

⏹️ ▶️ Ben Cohen There is more. So the compiler, I actually don’t have the right percentage.

⏹️ ▶️ Ben Cohen, Marco It’s

⏹️ ▶️ Ben Cohen actually slightly difficult to tell, because if you look at the GitHub

⏹️ ▶️ Ben Cohen, Marco repository, it gives you lies

⏹️ ▶️ Ben Cohen for two reasons. One is we have a lot of tests written in Swift, and those shouldn’t count. But

⏹️ ▶️ Ben Cohen also, we have started the process of writing parts of the compiler in Swift.

⏹️ ▶️ Ben Cohen And that started quite a while ago now, I think maybe four years ago now. But when we do

⏹️ ▶️ Ben Cohen that, we actually create those bits of the compiler that we rewrite as packages. And when you do that, we

⏹️ ▶️ Ben Cohen break them out into a separate repo. So if you go to github.com slash Apple, for

⏹️ ▶️ Ben Cohen now, soon, Swiftlang, slash Swift dash driver, that was the first part of

⏹️ ▶️ Ben Cohen the Swift compiler that we started rewriting in Swift. That happened about four

⏹️ ▶️ Ben Cohen years ago. And the driver is basically the way into the front end of the compiler. So it’s the thing

⏹️ ▶️ Ben Cohen that does the initial processing of your command lines, and it organizes the build and things like that. That was

⏹️ ▶️ Ben Cohen written in Swift. Two years ago now, we started rewriting the parser in Swift,

⏹️ ▶️ Ben Cohen and so that is actually part of a wider project called Swift Syntax, which is itself written in Swift,

⏹️ ▶️ Ben Cohen which is originally a way of just manipulating Swift code. It was a library for manipulating Swift code,

⏹️ ▶️ Ben Cohen and that evolved into a replacement for our current C++ parser.

⏹️ ▶️ Ben Cohen Those are based around Swift syntax and the Swift parser. We have some ongoing work

⏹️ ▶️ Ben Cohen that’s happening at the moment to do the next layer down, which is what’s called AST generation.

⏹️ ▶️ Ben Cohen So what you do is you parse the code and then you turn it into an abstract syntax tree. And then you have to lower that

⏹️ ▶️ Ben Cohen down into the underlying representation. That is ongoing at the moment. And

⏹️ ▶️ Ben Cohen once we’ve done the AST gen layer, we will actually be throwing away the C++ parser.

⏹️ ▶️ Ben Cohen Now, that’s going to be an interesting moment, because that is the point at which there is no way back.

⏹️ ▶️ Ben Cohen That is the point at which you will need a Swift compiler to build Swift. You

⏹️ ▶️ John can always go look back in the Git history. It’ll be there. It’s still there, sort

⏹️ ▶️ Ben Cohen of. Well, it is actually. It’s an interesting thing, because we have app developers sometimes

⏹️ ▶️ Ben Cohen point out that they have to wait a year or two before they can raise the minimum deployment target in order to use SDK

⏹️ ▶️ Ben Cohen features. We as compiler authors know that pain, because we

⏹️ ▶️ Ben Cohen cannot use the very latest Swift features when implementing the Swift compiler, because you have

⏹️ ▶️ Ben Cohen to be able to use the shipping compiler in order to bootstrap. So we’re very familiar with that. But

⏹️ ▶️ Ben Cohen yeah, and then more recently than that, we have started writing optimizer

⏹️ ▶️ Ben Cohen passes in Swift. So that is actually using C++ interop, which is another

⏹️ ▶️ Ben Cohen important feature of Swift. We obviously interoperate with LLVM, which is written in C++,

⏹️ ▶️ Ben Cohen and we use that to build our optimizer passes and things like that.

⏹️ ▶️ Ben Cohen And those are now written in Swift as well. So we are getting there. It’ll be

⏹️ ▶️ Ben Cohen a ways away. It’s not our main goal. We don’t rewrite things for the sake of it, even

⏹️ ▶️ Ben Cohen though it’s written in C++. It’s working, and so really when we decide

⏹️ ▶️ Ben Cohen we want to do something where we want to rewrite a part of the compiler, we try to make it for a good reason, right?

⏹️ ▶️ Ben Cohen And those good reasons can be, for example, creating a macro system with a nice, friendly Swift

⏹️ ▶️ Ben Cohen API, We usually do it in order to simplify

⏹️ ▶️ Ben Cohen them and make them more effective. Yeah, so we are

⏹️ ▶️ Ben Cohen on that path to self-hosting.

⏹️ ▶️ Marco It’s going to feel really good when you get to delete that code, though.

⏹️ ▶️ Ben Cohen It feels very good to delete code.

⏹️ ▶️ Casey So, Bill, I’m not sure which one of you is more appropriate to answer the following, but building on that, it certainly seems

⏹️ ▶️ Casey the implication is there is a strong interest to become self-hosted. And I’m

⏹️ ▶️ Casey not sure I’m the best person to summarize that, but basically the Swift compiler is written in Swift, right? Is it fair to say

⏹️ ▶️ Casey the eventual, I’m not looking for a date, but the eventual one sometime goal would be to self-host

⏹️ ▶️ Casey entirely if possible? Is that fair to say? We

⏹️ ▶️ Marco don’t comment on future products. Well,

⏹️ ▶️ Ben Cohen this is not a product. This is the Swift

⏹️ ▶️ Ben Cohen, Casey language that is entirely

⏹️ ▶️ Ben Cohen open source and that we are perfectly at liberty to comment on. So yes, I think the ultimate goal is that the compiler should be written

⏹️ ▶️ Ben Cohen in Swift. If nothing else, it does improve the safety of the compiler.

⏹️ ▶️ Ben Cohen The compiler is not filled with segfaults.

⏹️ ▶️ Ben Cohen They can happen, and obviously rewriting parts of it in Swift eliminates that possibility because it’s a safer language.

⏹️ ▶️ Ben Cohen And so that’s one benefit that comes from it as well as bringing other features. The other benefit is it makes

⏹️ ▶️ Ben Cohen it more approachable for outside people. I mean, you were talking about working on the Swift compiler as if it’s a very intimidating

⏹️ ▶️ Ben Cohen thing, but at the end of the day, it’s actually kind of pretty straightforward code when you look

⏹️ ▶️ Ben Cohen at a small part of it, right? When you look at a particular optimization pass, you can usually see pretty much what

⏹️ ▶️ Ben Cohen it’s doing, and it’s actually a great opportunity to get contributors involved. I know Holly’s worked with

⏹️ ▶️ Ben Cohen quite a lot of people who’ve come new to the Swift programming language as well.

⏹️ ▶️ Holly Borla Holly Smith-McCartney Yeah, we also organize a mentorship program called the Swift Mentorship Program, where

⏹️ ▶️ Holly Borla open source contributors who are interested in contributing to various parts of the Swift project, including but not limited

⏹️ ▶️ Holly Borla to the compiler, to the compiler

⏹️ ▶️ Holly Borla and they worked together for 10 weeks on open source contributions.

⏹️ ▶️ Holly Borla And a lot of people, I find that a lot of people who write Swift who are iOS developers are really interested in making

⏹️ ▶️ Holly Borla some contributions to the compiler just as a learning experience or better understanding

⏹️ ▶️ Holly Borla how their code works. If you’re in the depths of how type inference

⏹️ ▶️ Holly Borla or the actor isolation checker works, it gives you a little more knowledge into how the compiler

⏹️ ▶️ Holly Borla sees your code when you’re writing Swift code. So yeah, it’s a cool program and a really good

⏹️ ▶️ Holly Borla learning experience for people who are writing Swift. And I completely agree that moving more of the

⏹️ ▶️ Holly Borla compiler over to Swift will make contributing to the compiler a lot more approachable for people.

⏹️ ▶️ John Does that include the standard library? Yes. Like if

⏹️ ▶️ John, Holly Borla someone wants

⏹️ ▶️ John to add a method that says first, second, third, spelled out, fourth, fifth, sixth, and you stop them when they get to

⏹️ ▶️ John 32nd. Like that’s all Swift code in the standard library. So you can contribute to that and say, hey, I contributed to the Swift language,

⏹️ ▶️ John but you’re just making Swift methods in the

⏹️ ▶️ Marco, John library.

⏹️ ▶️ Marco So I’m curious, and probably for Holly, as we go into this new era of Swift concurrency

⏹️ ▶️ Marco and data race safety and everything, Swift, I think, has always

⏹️ ▶️ Marco struck an interesting balance. I think it’s kind of a roller coaster. Sometimes it’s more successful

⏹️ ▶️ Marco than other times at this balance of being easy to use for non-experts

⏹️ ▶️ Marco or newbies to a language, or just new programmers. And also having all this power

⏹️ ▶️ Marco behind it, and having quite a bit of complexity behind it. And

⏹️ ▶️ Marco as we go into this new data race safety era, how

⏹️ ▶️ Marco do you strike that balance? Obviously, these are some very advanced concepts, and somebody might get some

⏹️ ▶️ Marco warning as they’re building their code, saying something’s not sendable because it has mutable state, and they might not even know what any of

⏹️ ▶️ Marco that means. How do you balance that with being approachable to new programmers or

⏹️ ▶️ Marco to less experienced programmers?

⏹️ ▶️ Holly Borla Yeah. So the goal for concurrency is really similar to what we’ve

⏹️ ▶️ Holly Borla accomplished with other advanced features of the language, like the generic system is the one that I always go to. Because

⏹️ ▶️ Holly Borla from the very first lines of code that you write in Swift, you’re using the generic system because you’re

⏹️ ▶️ Holly Borla using standard library types like Array, or you’re using frameworks like SwiftUI,

⏹️ ▶️ Holly Borla which are really heavily leveraging these advanced features to make APIs that are really natural

⏹️ ▶️ Holly Borla to use for programmers. But you don’t need to understand generics. You don’t need to understand how it works until

⏹️ ▶️ Holly Borla you’re at a point where you need to use those advanced features in your own code.

⏹️ ▶️ Holly Borla And that’s the end goal with concurrency as well. For newcomers to app development

⏹️ ▶️ Holly Borla or newcomers to Swift, when you’re writing code, by default that code should be on the main actor.

⏹️ ▶️ Holly Borla And you shouldn’t have to actively think about the fact that that code is on the main actor until you’re

⏹️ ▶️ Holly Borla trying to actively introduce concurrency into your project. And

⏹️ ▶️ Holly Borla at that point, you’ll be confronted when you make a mistake that can lead to a data race in your code. And I

⏹️ ▶️ Holly Borla think that both the progressive disclosures is the way to make that complexity

⏹️ ▶️ Holly Borla more approachable. But I also think introducing those checks at compile time

⏹️ ▶️ Holly Borla will also make learning to write concurrent code a lot more approachable for people who are new to concurrency

⏹️ ▶️ Holly Borla in general. And this is a continued evolution of making concurrent programming more approachable.

⏹️ ▶️ Holly Borla Like, concurrent programming is just notoriously really hard to get right. I don’t know if you’ve ever debugged a data

⏹️ ▶️ Holly Borla race before, for those of you who are listening. But if you have, you know that it can take days or even weeks.

⏹️ ▶️ Holly Borla And the introduction of dispatch, even, was a huge step forward for making concurrent

⏹️ ▶️ Holly Borla code easier to write. Working with dispatch queues is way easier than

⏹️ ▶️ Holly Borla managing low-level system resources like threads manually in your app. But you still

⏹️ ▶️ Holly Borla have to know when to apply those tools to protect mutable state in your code. And with data race

⏹️ ▶️ Holly Borla safety in Swift 6, you can’t get it wrong. The compiler will tell you if

⏹️ ▶️ Holly Borla there’s a risk of a data race in your code. And having to confront

⏹️ ▶️ Holly Borla those concepts at the point when you make a mistake is better for

⏹️ ▶️ Holly Borla forming a mental model of how concurrent code should be written in your project. So I’m really excited for people

⏹️ ▶️ Holly Borla to start to learn concurrency for the first time with data array safety in Swift 6, as opposed to, I

⏹️ ▶️ Holly Borla think, a lot of people right now have internalized how to use dispatch, and they’ve been using that for many years.

⏹️ ▶️ Holly Borla And now they’re trying to learn this other, like, it’s

⏹️ ▶️ Holly Borla not a completely different system in how you write code, but it is different in how you approach it and at what point you’re confronted

⏹️ ▶️ Holly Borla with the issues. And I think that might be a little bit more difficult than learning concurrency for the first time with

⏹️ ▶️ Holly Borla the compiler checks in place to help prevent you from making mistakes.

⏹️ ▶️ John Is that how you characterize the difference between the Swift concurrency and the predecessor concurrency systems

⏹️ ▶️ John at Apple? Like we’ve had Grand Central Dispatch, the Dispatch queues, NSOperationQueue,

⏹️ ▶️ John Pthreads back in the day, locks of various kinds over the years. And all

⏹️ ▶️ John of those were kind of, you’d have sessions on and they’d say, here’s how you properly use this. Here’s how many queues

⏹️ ▶️ John you should have and stuff like that. But it was all sort of like runtime stuff. And everything I hear about Swift concurrency is always,

⏹️ ▶️ John we will do these checks for you at compile time so that at runtime, you don’t have to run your thing to see if there is a problem

⏹️ ▶️ John or like audit the code and look over it. This is like the compiler that will check it for you and make sure it’s

⏹️ ▶️ John mostly OK. Yeah. Would you say that’s the big difference?

⏹️ ▶️ Holly Borla Yeah, absolutely. You should be able to program by bumper, where the compiler is there

⏹️ ▶️ Holly Borla to tell you, oh, no, you got this a little bit wrong, with actionable suggestions for how to fix that

⏹️ ▶️ John code. Yeah, so you’re talking about the progressive disclosure You don’t have to know about this until you start introducing concurrency. But I feel like

⏹️ ▶️ John that’s true of the Swift language, if you’re writing just Swift code. But once they have everyone else in this company makes a bunch of frameworks.

⏹️ ▶️ John And those don’t know or care about Swift concurrency for the most part. And they’re

⏹️ ▶️ John in your code. And you think, I haven’t introduced any concurrency. But it’s like, well, this method

⏹️ ▶️ John has a callback. And it is cranky now. And you’re like, but why? I didn’t make

⏹️ ▶️ John that API. It’s complaining about something that I don’t understand. It’s not an API that I wrote.

⏹️ ▶️ John And so you’re faced with this dilemma of just, you stare at it for a while. It’s like, should I not use that

⏹️ ▶️ John API? Should I? I think we’ve all had experience, and everyone you’ve probably

⏹️ ▶️ John talked to has had experience, trying to enable strict concurrency in 5.10. So when you set the setting

⏹️ ▶️ John in Xcode, you see all the warnings, and you’re like, how far away am I really? You’re like, how many? And

⏹️ ▶️ John I think we’ve all taken different swings at this. And I’ve seen you both sort of counter the conventional wisdoms. Like, I’ll

⏹️ ▶️ John just make everything sendable, And that will fix everything, but that doesn’t work. And so you’re like, well, maybe I can just add annotations. I’ll put main actor

⏹️ ▶️ John and a bunch of things, but that doesn’t work. And it’s like, well, maybe I’ll just sprinkle a zoom isolated everywhere. That’s probably not the right approach.

⏹️ ▶️ John And I think my personal experience is I’ve taken like four different runs at bringing

⏹️ ▶️ John one of my apps onto stricken currency and I just keep backing off and scratching my, I know there’s a WWC session about it and I haven’t

⏹️ ▶️ John seen it, my bad. It was a busy day yesterday and it’s migrating to Swift concurrency, but I feel like that is a lot of the barrier and

⏹️ ▶️ John it’s nothing to do with the language. It has to do with the APIs that we’re using that were created, you know, decades ago

⏹️ ▶️ John that have their own conventions. And stricken currency, and it’s not wrong, it’s correct. There is a potential for

⏹️ ▶️ John a mutable state to be messed up there. And then, of course, even in our own code, it’s like, well, I use queues for this, and I use locks. And

⏹️ ▶️ John I’m pretty sure it’s safe. But stricken

⏹️ ▶️ John, Marco currency says.

⏹️ ▶️ John Well,

⏹️ ▶️ Marco that’s what unchecked

⏹️ ▶️ John sendable is for. Yeah. But that’s the whole thing. Like, you don’t want to go through and sprinkle it through. It says, I’m

⏹️ ▶️ John sure this is OK. I’m sure this is OK. Like, there are annotations to do that. But all you’re doing is undercutting yourself

⏹️ ▶️ John by saying, no, I’m totally sure the code I wrote last year is bug free, and there is no races. And it will satisfy the compiler,

⏹️ ▶️ John but you haven’t actually solved the problem. You haven’t actually used the system you’re saying, which is you should be able to write it. The compiler tells you whether

⏹️ ▶️ John it’s wrong. You might as well just turn that mode off. So I mean, I think a lot of users

⏹️ ▶️ John find it frustrating, but it is a difficult problem. And I’m assuming, well, you tell me what you think the correct approach

⏹️ ▶️ John is. Give me the three-second summary of the session that I didn’t watch.

⏹️ ▶️ Holly Borla I’ll let Ben do that in a

⏹️ ▶️ Holly Borla, Ben Cohen Ben session.

⏹️ ▶️ Ben Cohen It is, and well done for Casey for getting ahead of John and watching it already. So

⏹️ ▶️ Ben Cohen it really partly depends on what kind of frameworks you’re using. And it’s possible that you’re using some frameworks that

⏹️ ▶️ Ben Cohen make it harder or easier, depending on what kind of code you’re using. MARK

⏹️ ▶️ Ben Cohen, Marco MIRCHANDANI Right. MAC framework.

⏹️ ▶️ Ben Cohen Right. Well, you’re screwed. So for example,

⏹️ ▶️ Ben Cohen the UI layer, we’ve actually, and it’s worth trying the new SDK, because at the UI layer, there’s been a lot

⏹️ ▶️ Ben Cohen of work to indicate which parts of SwiftUI, also UIKit and the AppKit, are

⏹️ ▶️ Ben Cohen by definition always supposed to be running on the main thread. And that should actually, for people who’ve

⏹️ ▶️ Ben Cohen tried 5.10, it’s well worth downloading the new SDK and giving that a go.

⏹️ ▶️ John Does that also include, like, I know this is a documentation issue, but often you’ll see a thing with a callback and you have

⏹️ ▶️ John a question. It’s like, what thread will the callback run on? And you’re just like, oh, you’re just supposed to know. Whatever you

⏹️ ▶️ John register it on, that’s the thread the callback will run on. But you don’t see that in the documentation. So you’re like, well, I registered

⏹️ ▶️ John for this on the main thread. And when the callback gets called, it will probably get called on the main thread. And sometimes they take a queue

⏹️ ▶️ John as an argument and you just have to know that the main queue is the same as the main thread. But like documentation wise, I always feel like I

⏹️ ▶️ John look up one of these old app kit things and I’m just, it’s guesswork, right? Well,

⏹️ ▶️ Casey but did you know, John, I learned this morning that there’s a keyword there. What is it? It’s assume,

⏹️ ▶️ Casey assume

⏹️ ▶️ Casey, Ben Cohen main thread. Yeah, assume isolated. There it is. I knew I couldn’t quite get there.

⏹️ ▶️ Casey But there’s tools for this, John, as it turns out. I

⏹️ ▶️ Casey, John know, but assume isolated.

⏹️ ▶️ John, Marco That’s

⏹️ ▶️ Marco not the tool for that. You’re nuts, don’t do

⏹️ ▶️ John that. Assume isolated, all it’s gonna do is throw a runtime error when it finds out it’s not on the main thread.

⏹️ ▶️ John, Marco It’s like a

⏹️ ▶️ Marco scenario, right? Just dispatch it to me.

⏹️ ▶️ Ben Cohen So assumeIsolated does throw a runtime error when you’re not on the main thread.

⏹️ ▶️ Ben Cohen This is actually something that a lot of good programmers are already doing, which is they put in preconditions where

⏹️ ▶️ Ben Cohen they know this is supposed to be on the main thread. And they put in a precondition just in case they call it from somewhere

⏹️ ▶️ Ben Cohen else in their app where they’re getting a call from a dispatch queue that’s not isolated to the main thread.

⏹️ ▶️ Ben Cohen And that can lead to trouble. I think somebody was saying earlier,

⏹️ ▶️ Ben Cohen you run your program and you find out it doesn’t quite work, as opposed to at compile time you find out that you need

⏹️ ▶️ Ben Cohen, John to do something. Yeah, it feels

⏹️ ▶️ John like it’s undercutting the bumper thing Holly was saying. It’s like, I don’t want to find out at runtime. So every time I do assume isolated,

⏹️ ▶️ John I’m like, there must be a better way.

⏹️ ▶️ Marco Don’t use that there, man. That’s not what it’s for.

⏹️ ▶️ Ben Cohen So I would say that finding out at runtime that your code is broken is the best case scenario under

⏹️ ▶️ Ben Cohen, Marco the old world, which is

⏹️ ▶️ Ben Cohen that you really hope to find out when you run your code that something is wrong. But what

⏹️ ▶️ Ben Cohen actually happens is that in some of these techniques,

⏹️ ▶️ Ben Cohen you find out in the wild when your program is crashing and you do not exactly know why.

⏹️ ▶️ Ben Cohen I’m always amused by people who make these jokes on Mastern on Twitter where they say like, they make

⏹️ ▶️ Ben Cohen a joke about concurrency where they jumble up the words. And that’s cute, but that is again,

⏹️ ▶️ Ben Cohen the best case scenario is jumbled up words. You crash, you corrupt user data. This is no

⏹️ ▶️ Ben Cohen good. And so that’s why a lot of people

⏹️ ▶️ Ben Cohen have these really great practices in the old world of dispatch, where they will insert these

⏹️ ▶️ Ben Cohen assertions saying, I want you to stop me if I’m not running on the main queue.

⏹️ ▶️ Ben Cohen So I think the long-term goal is that we need to lift

⏹️ ▶️ Ben Cohen this information out of documentation. We want to take it out of documentation and put it actually in

⏹️ ▶️ Ben Cohen the definition of the API. It’s not in the documentation now, so you don’t have to lift it up.

⏹️ ▶️ Ben Cohen Wow. So the benefit of putting it there so

⏹️ ▶️ Ben Cohen that the compiler actually enforces it is that you can’t not have that information. By definition,

⏹️ ▶️ Ben Cohen your code does encapsulate the information about where you are running and how it’s running.

⏹️ ▶️ John Because one of the things I do when flailing is there’s a callback. And I’m like, can I just annotate the callback as main

⏹️ ▶️ John actor? And the answer is no, you can’t. And then it’s like, why? Is it already

⏹️ ▶️ John on? always on the main thread is, you know, I figure what the error is. I’m sure.

⏹️ ▶️ Marco Just wait for the framework to update with async calls.

⏹️ ▶️ John Yeah.

⏹️ ▶️ John, Marco Well, we

⏹️ ▶️ John don’t have all the time in the world to wait. And yeah, it’s a, it’s, what it comes down to, like you mentioned queues, right?

⏹️ ▶️ John So I, I, one of my apps has concurrency. I’m sorry, it does. And

⏹️ ▶️ John I use queues. And in one situation, I wrote a little class and I use locks, old, old style locks. And

⏹️ ▶️ John pretty sure it’s probably okay. But I look at that and I’m like, I would like to use Swift concurrency because then I would

⏹️ ▶️ John be, feel more sure. But there’s nothing you can do to sort of annotate or mark up dispatch queues or

⏹️ ▶️ John locks other than the reassurance of just telling the compiler, I’m pretty sure that I’m right. I would

⏹️ ▶️ John rather just like pull that out and reimplement it with actors and so on.

⏹️ ▶️ John And that sometimes just seems daunting.

⏹️ ▶️ Holly Borla So another thing that there’s a ton of Swift code out there and Swift code that

⏹️ ▶️ Holly Borla interoperates with C-based languages like Objective-C and C++. at the start

⏹️ ▶️ Holly Borla of this transition to start to integrate Swift’s native, safer concurrency

⏹️ ▶️ Holly Borla primitives into these vast code bases that are using older library-based concurrency

⏹️ ▶️ Holly Borla primitives, like dispatch queues. The system is designed for incremental migration. So in

⏹️ ▶️ Holly Borla the case if you have a class backed by a dispatch queue, there is a technique that you can use

⏹️ ▶️ Holly Borla to turn that class into an actor that’s backed by a dispatch queue.

⏹️ ▶️ Holly Borla It uses a fancy feature called custom actor executors, But the way to do it, it’s only like four or five lines

⏹️ ▶️ Holly Borla of code that you actually have to write in your own code. And what that lets you do is, from your Swift code, it lets you

⏹️ ▶️ Holly Borla use the static actor isolation and not have to mess with the dispatch queue. But when you’re interacting

⏹️ ▶️ Holly Borla with APIs that are based on dispatch queues, you can still pass the dispatch queue there.

⏹️ ▶️ Holly Borla And then you can bridge between the dynamic isolation in the static world with tools like assumeIsolated.

⏹️ ▶️ John That brings up another question of incremental adoption. I know this Swift 6 just came out.

⏹️ ▶️ John And in the old 5 world, we had the little setting to set it on complete concurrency or whatever. I

⏹️ ▶️ John, Ben Cohen know

⏹️ ▶️ John, Marco there’s

⏹️ ▶️ John a whole bunch of features in Swift 6 and new things for settability and everything that make it easier. But what

⏹️ ▶️ John is the mechanism in your project of saying, like, I want, you know, is

⏹️ ▶️ John it per module? Is it per file? To saying, I want the Swift 6 language features, but this file’s not ready for

⏹️ ▶️ John strict concurrency. What does that look like?

⏹️ ▶️ Holly Borla, John Yes.

⏹️ ▶️ Holly Borla Yeah, the setting is per module. So in your Xcode build settings, there’s a language version setting,

⏹️ ▶️ Holly Borla or if you’re in a Swift package manifest, There’s an API for setting it per target. And many

⏹️ ▶️ Holly Borla people currently have that set to something, whether it’s 4, 4.2, or 5. So you would change

⏹️ ▶️ Holly Borla that to 6 for the specific module that you’re looking to migrate to Swift 6. And

⏹️ ▶️ Holly Borla then if you have a particular file that violates some of the rules in

⏹️ ▶️ Holly Borla ways that are really difficult for you to change, there are ways to opt out of checking

⏹️ ▶️ Holly Borla in specific areas in your project using things like pre-concurrency import statements. if

⏹️ ▶️ Holly Borla the issue is in an API that you’re using, or tools like non-isolated unsafe,

⏹️ ▶️ Holly Borla if you have, for example, a global variable that you’re manually guarding with a lock or a queue,

⏹️ ▶️ Holly Borla at the point when you access it, you can use non-isolated unsafe to opt out of the compiler’s checking there. So there are

⏹️ ▶️ Holly Borla a variety of tools like that to let you opt out of the checking in narrow situations in your code. And then those

⏹️ ▶️ Holly Borla are also things like handles that you can audit for later to actually take a look

⏹️ ▶️ Holly Borla at the opt-outs that you’re using in your code and try to use those as refactoring opportunities

⏹️ ▶️ Holly Borla to rewrite some of that code to use something safer.

⏹️ ▶️ John So you’re picking the Swift 6 as the language, and that includes everything having to do with Swift 6. When you pick Swift 6,

⏹️ ▶️ Ben Cohen no? No. So Swift 6, the language mode, where you go into the Xcode settings and you say language

⏹️ ▶️ Ben Cohen mode of Swift 6, that purely governs the strict concurrency checking. So

⏹️ ▶️ Ben Cohen the Swift 6 compiler that you get with the latest Xcode, that has all of the new features. So I think you’ve

⏹️ ▶️ Ben Cohen made a glancing blow to non-copyable types. Those features are available.

⏹️ ▶️ Ben Cohen New generic capabilities for non-copyable types are available in the Swift 6 compiler. You do not need to turn on.

⏹️ ▶️ John So you would pick the Swift 5 language mode, but it’s using the Swift 6 compiler to run in Swift 5 language

⏹️ ▶️ John mode. You get non-copyable types, you don’t get the stricken currency.

⏹️ ▶️ Ben Cohen That’s right, and that’s exactly, this is part of a journey that the entire Swift ecosystem needs to go through.

⏹️ ▶️ Ben Cohen So being ready for Swift 6, having your dependencies ready for Swift 6,

⏹️ ▶️ Ben Cohen There’s actually a swiftpackageindex.com, which is this great website. They have a tracker

⏹️ ▶️ Ben Cohen now that tells you which packages they are compiling that build cleanly under Swift 6 code. But

⏹️ ▶️ Ben Cohen it really does depend on the nature of your program and whether your dependencies are now ready for Swift 6, whether you

⏹️ ▶️ Ben Cohen want to turn on that language mode. And this dates back to, we’ve been doing this now since the Swift 4

⏹️ ▶️ Ben Cohen days. So since we introduced the Swift 4 language mode,

⏹️ ▶️ Ben Cohen this source compatibility guarantee promise that whenever you download the new compiler,

⏹️ ▶️ Ben Cohen with a couple of exceptions where maybe there are a couple of issues with your code, where maybe

⏹️ ▶️ Ben Cohen the code was explicitly incorrect, we always want you to be able to compile your code

⏹️ ▶️ Ben Cohen as is with the latest compiler. And then when you’re ready for some breaking change,

⏹️ ▶️ Ben Cohen there were a few in Swift 5, and obviously in Swift 6, the key change here is strict

⏹️ ▶️ Ben Cohen concurrency, on a per target basis. Is

⏹️ ▶️ John that like a longstanding kind of marketing decision to tie them to the, I mean,

⏹️ ▶️ John just deciding that Swift 6 means stricken currency? You could have, for example, said Swift 6 just means Swift 6 language

⏹️ ▶️ John features and there’s some other option for stricken currency. But you said, no, we’re tying this feature to this

⏹️ ▶️ John number because people want the higher number. Is that like a sort of a social engineering

⏹️ ▶️ John decision?

⏹️ ▶️ Ben Cohen Yeah, it’s a way of thinking about the forward progress. I mean, you don’t want to be stuck in this world with

⏹️ ▶️ Ben Cohen the Python 2 to 3 transition

⏹️ ▶️ Ben Cohen, Marco style thing,

⏹️ ▶️ Ben Cohen where those were tied to updating your compiler and then you couldn’t get the new

⏹️ ▶️ Ben Cohen stuff without changing your code to adapt to the way that the new language works. So it’s

⏹️ ▶️ Ben Cohen this way of helping engineer the ecosystem to help have this continuous forward

⏹️ ▶️ Ben Cohen progress. But at the end of the day, some people have written code in such a way that

⏹️ ▶️ Ben Cohen it won’t be so easily adapted to Swift concurrency. frameworks, and a lot of async await,

⏹️ ▶️ Ben Cohen and the path for them is actually pretty clean. And so we want people to be able to opt in to that.

⏹️ ▶️ Ben Cohen The choice as to whether you opt in or not is up to you. If you’re finding that you are experiencing quite

⏹️ ▶️ Ben Cohen a lot of pretty gnarly crashes, it’s probably worth considering opting in.

⏹️ ▶️ Ben Cohen One great time to opt in is if actually you want to start introducing a lot more parallelism to

⏹️ ▶️ Ben Cohen your code. So we have these powerful new devices, they have many cores.

⏹️ ▶️ Ben Cohen find yourself with an app that previously was doing most of its work on the main thread with a little bit of background processing, but you really

⏹️ ▶️ Ben Cohen want to take advantage of a lot more parallelism in your code, that would be a great time to turn on Swift 6 mode

⏹️ ▶️ Ben Cohen in order to know that you can do those refactorings without

⏹️ ▶️ Ben Cohen fear of introducing new data races. So yeah, it’s really up to each individual project to make

⏹️ ▶️ Ben Cohen that decision and to see how the community is moving forward with them in order to update

⏹️ ▶️ Ben Cohen their dependencies and then take the plunge.

⏹️ ▶️ John Do you worry about like releasing Swift version 10 many years from now and huge

⏹️ ▶️ John code bases are still in Swift 5 language mode? Like they’re using a Swift 10 compiler to run Swift 5

⏹️ ▶️ John language mode because they could never get the wherewithal to go strict concurrency compliant. And you’re just

⏹️ ▶️ John plowing bravely forward here at Apple for making version after version and they’re all great, but they can never cross the six threshold

⏹️ ▶️ John because they can never get their code to run under strict concurrency because of millions of lines of like dispatch queue

⏹️ ▶️ John and manually created locks. Like do you worry about hindering your products? You’ve basically made a hard gate of,

⏹️ ▶️ John you’re not going to be running in Swift 7 next year or whenever if you can’t go strict concurrency. And you’re

⏹️ ▶️ John like, well, my reason I can’t go is because we have 10 million lines of manually managed locks or something.

⏹️ ▶️ Ben Cohen So it really only governs a handful of things. So the goal is always, whenever we

⏹️ ▶️ Ben Cohen introduce a new language feature, that you do not have to update the new language mode. We were looking at somebody’s project yesterday

⏹️ ▶️ Ben Cohen where they were still on Swift 4 mode. And really, there was not that much they were missing out on.

⏹️ ▶️ Ben Cohen So we have this long-term promise to always support those language

⏹️ ▶️ Ben Cohen features so that people aren’t forced to update. But like I say, most of the language features themselves

⏹️ ▶️ Ben Cohen are not gated on the language version. And so really it’s only when we need to take these big

⏹️ ▶️ Ben Cohen step forwards that we encourage people to upgrade.

⏹️ ▶️ John They’d be running in Swift 5 language mode, but they’d still have access to all the new Swift 10 features, but they would feel bad about themselves

⏹️ ▶️ John because their number is five and you’re rolling out seven and eight and nine and 10. And people, they look at the little gamified

⏹️ ▶️ John badge on the Swift package index and like, you don’t have the little things that are Swift 10 compliant and I have a little star next to my package. And you don’t,

⏹️ ▶️ John it’s like, I get the language features, it’s just not compliant.

⏹️ ▶️ John, Holly Borla So you

⏹️ ▶️ Holly Borla do- I also think there’s a misconception that you need to totally eliminate all of the uses of

⏹️ ▶️ Holly Borla tools like locks and dispatch queues in order to migrate to Swift 6. I don’t think that’s true.

⏹️ ▶️ Holly Borla I think locks, I mean, the Swift 6 standard library includes a new primitive

⏹️ ▶️ Holly Borla mutual exclusion lock called mutex, and that is a tool that people can and should use in some scenarios

⏹️ ▶️ Holly Borla in their code. And I know there are a variety of other lock types out there that people are currently using. You don’t need to stop using those types

⏹️ ▶️ Holly Borla in order to migrate your code base to the Swift 6 language mode. The same thing is true

⏹️ ▶️ Holly Borla of dispatch queues. And like I said, part of the reason why the system is built on incremental

⏹️ ▶️ Holly Borla migration is because we know there’s so much concurrent code out there that is using

⏹️ ▶️ Holly Borla dispatch and other concurrency primitives. And if you had to eliminate or just totally

⏹️ ▶️ Holly Borla refactor all of your code in order to migrate to Swift 6, nobody would ever do it. So

⏹️ ▶️ Holly Borla I don’t think you need to actually massively refactor your code in order to migrate to Swift 6.

⏹️ ▶️ Holly Borla Though in some cases, like in Ben’s talk, you’ll see the talk that he gave back in 2021,

⏹️ ▶️ Holly Borla he actually took a sample app. And it was using Dispatch. And he went through and

⏹️ ▶️ Holly Borla replaced some uses of Dispatch queues with actors. And that might make the migration

⏹️ ▶️ Holly Borla a little bit easier in some cases, but you’ll sort of see when you watch the talk,

⏹️ ▶️ Holly Borla some of the things that are made easier by introducing actors in some places, but it is still possible to do it if you’re using

⏹️ ▶️ Holly Borla other things like dispatch queues.

⏹️ ▶️ Ben Cohen Paul Battelle-Wilson I have seen that talk. One of the challenges there is that doing that refactoring

⏹️ ▶️ Ben Cohen prior actually made it a lot easier to migrate to Swift 6 and that’s actually something that we’d encourage is people

⏹️ ▶️ Ben Cohen who have been adopting Async and Await and things like that,

⏹️ ▶️ Ben Cohen also in the latest compiler added a lot more affordances,

⏹️ ▶️ Ben Cohen for example, around not having to make your type sendable, but also be able to pass them through between isolation

⏹️ ▶️ Ben Cohen domains. One of the challenges with writing the latest talk

⏹️ ▶️ Ben Cohen is that actually I had these great examples of problems that I was going to talk about,

⏹️ ▶️ Ben Cohen and then we fixed the compiler

⏹️ ▶️ Ben Cohen, Holly Borla so that they weren’t a problem anymore. It happened like

⏹️ ▶️ Holly Borla three times. That’s a good problem to have.

⏹️ ▶️ John That’s a very good problem to have. I mean, that brings me to the next topic. for both of you, what is it like

⏹️ ▶️ John developing Swift in the open? Because I’m watching all year on Swift Evolution, I see the features coming in Swift 6

⏹️ ▶️ John as part of the reason I kind of backed off my recent attempt, I’m like, look, they’re fixing a bunch of stuff in Swift 6. And you see them go by, you see

⏹️ ▶️ John the proposals here, we’re doing this thing, they’re fixing the problems in your talk, and I see it happening all throughout the year. That’s very

⏹️ ▶️ John different than most other people here at Apple. We, I mean, maybe some people sit down for WWDC and they’re shocked by Swift 6,

⏹️ ▶️ John but if you’re following the forums and watching the proposals, it’s developed in the open. It’s

⏹️ ▶️ John open source, the process of deciding what goes into it is open, there’s no mystery

⏹️ ▶️ John involved. What is that like for you in a company where that is absolutely not true of all the other teams that you’re

⏹️ ▶️ John working with? Except for maybe WebKit.

⏹️ ▶️ Ben Cohen Paul Battista For WebKit, but also increasingly we’re seeing more of this

⏹️ ▶️ Ben Cohen style of operating. Foundation now is operating in a similar fashion.

⏹️ ▶️ Ben Cohen And that has actually been key to the next thing that we’ve announced this year,

⏹️ ▶️ Ben Cohen across platforms. So the same foundation that you’re running

⏹️ ▶️ Ben Cohen on your phone and on your Mac is the foundation code that you will be running if you

⏹️ ▶️ Ben Cohen were to stand up a server running on Linux. And so they’ve been running

⏹️ ▶️ Ben Cohen language proposals, sorry, language proposals, framework proposals to

⏹️ ▶️ Ben Cohen introduce new features, such as I think Predicate, which is a foundation

⏹️ ▶️ Ben Cohen type, we acquired support for Ragexes, and that proposal was discussed in the open.

⏹️ ▶️ Ben Cohen And then the other example, I heard your podcast last week where

⏹️ ▶️ Ben Cohen you were wondering, speculating about whether there was going

⏹️ ▶️ Marco to be a new testing framework.

⏹️ ▶️ John Paul Keefer That’s because I couldn’t remember the name of Swift Testing. That’s the one I had seen, yes.

⏹️ ▶️ Ben Cohen And yeah, so Swift Testing was developed in the open.

⏹️ ▶️ Ben Cohen We had some really great community feedback from that. That’s

⏹️ ▶️ Ben Cohen another place where we’re doing that kind of open dialogue with the community about

⏹️ ▶️ Ben Cohen the next layer up of Swift framework features.

⏹️ ▶️ John BRIAN DORSEY JR.: Is there any, like, can you use it as an example to the other groups? Look,

⏹️ ▶️ John we have a public issue tracker. And when people have problems, we can discuss them in the open. And look how much more

⏹️ ▶️ John efficient it is to go back and forth on GitHub issues and discuss proposals. And these other groups are

⏹️ ▶️ John sending carrier pigeons across the country through seven different intermediary parties of this game of telephone

⏹️ ▶️ John to find one crashing bug. Like, do you ever pitch the other groups and say, hey. I mean, I obviously worked

⏹️ ▶️ John on Foundation. This could be you. You could be getting bug reports from people and communicating with them in an

⏹️ ▶️ John efficient manner and fixing

⏹️ ▶️ Ben Cohen them. Yeah, we get a huge amount of benefit from the Swift community, I think, when we

⏹️ ▶️ Ben Cohen bring ideas to them for new language features. We get this

⏹️ ▶️ Ben Cohen real-time feedback where the people on the forums, they spot issues with what we’re proposing

⏹️ ▶️ Ben Cohen that we had not thought about. And we iterate

⏹️ ▶️ Ben Cohen with them on that, and we get a huge amount of value from getting that real-time feedback

⏹️ ▶️ Ben Cohen from people. And so I would say that’s certainly been a valuable process for us.

⏹️ ▶️ John Peter. Plus you get to argue about keywords. The true purpose of every

⏹️ ▶️ John, Marco language evolution list.

⏹️ ▶️ Ben Cohen We’ve fallen into this mode now where this is something we’ve

⏹️ ▶️ Ben Cohen evolved as a process that Holly and I sit on, which is we’re

⏹️ ▶️ Ben Cohen now in this mode where we will agree a proposal in principle, where we talk about the fundamentals

⏹️ ▶️ Ben Cohen of the language proposal and how it’s going to work. And then what we say is we’ve agreed that in

⏹️ ▶️ Ben Cohen principle, and now there’s like a free swim where everybody gets to specifically focus on the name we’re

⏹️ ▶️ Ben Cohen going to use for the keyword. And that has actually helped the process a lot because

⏹️ ▶️ Ben Cohen the bike shedding is a shiny thing that people immediately move towards. And so if you say, let’s park

⏹️ ▶️ Ben Cohen the naming discussion for now. Let’s talk about the fundamental feature. Then when we’ve agreed the fundamental feature and we accept it in

⏹️ ▶️ Ben Cohen principle, then we can have a discussion about what we’re actually going to call it.

⏹️ ▶️ John And I mean, I know that’s a source of contention, and it’s a silly argument with people. But it really does make

⏹️ ▶️ John a big difference in language. Some people look at the Swiss Evolution or other language lists, and they’re like, it just seems like a

⏹️ ▶️ John bunch of people arguing over whether copyable should have a tilde in front of it, or it should be a new keyword.

⏹️ ▶️ John But that’s so important. Because those decisions you make, people live with those for decades. So you

⏹️ ▶️ John should spend a month arguing about it. Because I’ve seen it change. And for the illusion,

⏹️ ▶️ John the original proposal will have this thing or whatever, and you’ll end up with a different thing. And it’s better. You’re making it better by arguing about

⏹️ ▶️ John it. I guess people just don’t have a tolerance for it. They think, oh, it’s not important. I don’t care what the word is called. But it makes such a big difference to the language.

⏹️ ▶️ John And any time you make a slightly wrong choice, like I remember I was talking to, I don’t know, it was Dennis Ritchie or one of

⏹️ ▶️ John the old Unix guys or whatever. He said, do you have any regrets about your career? And he said, I wish I had put E in E on the create

⏹️ ▶️ John system call, you know, C-R-E-A-T. Wow. How long has he been living with that, thinking like, I just, I wanted to save

⏹️ ▶️ John that character, and now it’s create for just for the rest of it. We’re all, it’s on Mac OS, it’s on every Apple platform

⏹️ ▶️ John right now somewhere, in the source code, there’s a call to create with no E on it, because this guy made a bad decision in

⏹️ ▶️ John the 70s. And so you don’t want that to be you, so yeah, spend the time arguing about it. And I think that what you said, like

⏹️ ▶️ John doing the, figuring out what you’re gonna do and then arguing about the keywords is a nice separation, so you can make forward progress, but

⏹️ ▶️ John I’m here to endorse arguing about keywords.

⏹️ ▶️ John, Holly Borla It’s also

⏹️ ▶️ Holly Borla really valuable because there was a recent proposal called Sending Parameter

⏹️ ▶️ Holly Borla and Result Modifiers. And we did the same thing there where we had the concept from the proposal,

⏹️ ▶️ Holly Borla we accepted it in principle, and then we had a revision review to focus on the name of the keyword, which was originally called

⏹️ ▶️ Holly Borla transferring. Now it’s called sending. But the revision review thread is really interesting because

⏹️ ▶️ Holly Borla a lot of people are coming in. And as part of justifying why they think this keyword should be called something

⏹️ ▶️ Holly Borla specific, they’re reasoning through how they’re thinking about the feature and how they would explain it to

⏹️ ▶️ Holly Borla other people. And at points where they maybe got something slightly wrong, someone else would come in and say,

⏹️ ▶️ Holly Borla oh, I think this actually works this way. And I think this keyword is a little bit misleading. And so that

⏹️ ▶️ Holly Borla review thread is really cool because it didn’t feel like a really heated, contentious

⏹️ ▶️ Holly Borla debate. It felt like a healthy debate of people trying to come in and explain a concept and then listening

⏹️ ▶️ Holly Borla to other people explain how they thought about it. And that’s also valuable for us in figuring out

⏹️ ▶️ Holly Borla how to actually explain the feature to Swift programmers, because

⏹️ ▶️ Holly Borla what the formal specification is in the proposal is not the level of detail

⏹️ ▶️ Holly Borla that you actually need to understand in order to use the feature. So yeah, those name bike shedding

⏹️ ▶️ Holly Borla threads are valuable for a bunch of different

⏹️ ▶️ Holly Borla, John reasons.

⏹️ ▶️ John That’s part of the reason doing it in public, I feel like, is so beneficial, because the people who are working on the proposal

⏹️ ▶️ John know it at such an intimate level. And then you throw it at a bunch of people who have no idea what you’re talking about. And they will tell you, this is confusing

⏹️ ▶️ John to me. Like if they’re using a term of art that’s meaningful to compiler people, or you’ve just all internalized as a group

⏹️ ▶️ John what this means because you’ve been debating it for a month or whatever. And the word doesn’t make

⏹️ ▶️ John in their mind, make them think of what it actually is. And so changing the word will make it more learnable

⏹️ ▶️ John and more memorable. And again, the people who don’t like bike-shedding will say, well, yeah, it’s a weird word, but you learn

⏹️ ▶️ John it. And then it just becomes internalized. That’s what happens to everybody, but that doesn’t make the language approachable. If you pick a good word,

⏹️ ▶️ John it will, if the word means what you want it to mean, it will help people learn the feature faster.

⏹️ ▶️ John I definitely find that because again, some Swift features, I read the proposal and I don’t understand it until

⏹️ ▶️ John you change the keyword. And then I’m like, I’ll read the same proposal. I’m like, oh, now I get it because the word you’ve

⏹️ ▶️ John chosen is different and now I understand what you’re getting at. Even non-copyable types like that, it’s like, didn’t understand

⏹️ ▶️ John what you were trying to do until it went around a few times. I’m like, okay, start like the sending and whatever. And

⏹️ ▶️ John I think you picked that because of the, was it part of the synergy with sendable

⏹️ ▶️ John, Holly Borla and everything? Connection with

⏹️ ▶️ Holly Borla concurrency. Yeah, previously it didn’t sound like it had anything to do with concurrency. And so

⏹️ ▶️ Holly Borla riffing off of sendable in a slightly different form so that it’s not like I’m talking about sendable versus sendable. Someone did

⏹️ ▶️ Holly Borla actually suggest calling it like lowercase s, sendable. But that’s really difficult to talk about. But sending

⏹️ ▶️ Holly Borla is close enough that it’s very clear you’re talking about sending a value over an isolation boundary, because that’s the term that Swift

⏹️ ▶️ Holly Borla uses for that concept. So you have this immediate connection to concurrency, and then you can dig in deeper to how it works.

⏹️ ▶️ John, Holly Borla Just

⏹️ ▶️ John don’t let the math people use the language.

⏹️ ▶️ John, Casey That’s all

⏹️ ▶️ Casey I’m saying. Well, it’s funny just to kind of reiterate what John said, you know, when I still had a real job and I was working with other

⏹️ ▶️ Casey switch developers, it was hilarious, the younger ones when our code base was, some

⏹️ ▶️ Casey Objective-C was largely Swift, but you would bring a young, typically

⏹️ ▶️ Casey a younger person who has grown up on more, you know, JavaScript-y languages. And I think

⏹️ ▶️ Casey Swift is like that, and I don’t mean that in a bad way, I mean that in a good way. It’s much more approachable. And

⏹️ ▶️ Casey they would look at a file of Objective-C, and they would just recoil because it just

⏹️ ▶️ Casey looks so different. Like, even though I like Objective-C just fine. I’m not a super fan, but I like it just

⏹️ ▶️ Casey fine. But it’s so much less approachable, I think, in so many ways because it’s so different. And I think those

⏹️ ▶️ Casey silly arguments about a tilde, one of you said a minute ago, like a tilde or not, and what keyword to use,

⏹️ ▶️ Casey they really dramatically, in aggregate, can change the whole kind of vibe of a language.

⏹️ ▶️ Casey And Swift’s vibe, I think Marco had said earlier, or maybe it was somebody who said,

⏹️ ▶️ Casey there was a window of time where it was getting a little architecture astronaut-y, I feel like, but

⏹️ ▶️ Casey I feel like that’s really been brought around in a good way. And I feel like we’re heading on a good path. And those

⏹️ ▶️ Casey arguments, while I was one of those people that was like, oh my God, why do I care? But then you, just like John said, you

⏹️ ▶️ Casey think about it for a minute and you’re like, oh no, this is what you two just said. This is worth arguing about. And I think it’s important.

⏹️ ▶️ John Architecture astronauts are saving your butt, okay?

⏹️ ▶️ John, Casey You know, that’s very true. You’re

⏹️ ▶️ John doing a good enough job of architecture astronaut and you’re like, oh, they all went away. I know they didn’t. They just did their job.

⏹️ ▶️ Casey No, that’s fair. That’s a fair correction.

⏹️ ▶️ Ben Cohen Paul Battelle Yeah, I mean, the goal is very much, we have to plot this path, right, between helping

⏹️ ▶️ Ben Cohen people make code correct and also helping make people easily able

⏹️ ▶️ Ben Cohen to bring forth what’s on their mind and make it like a low ceremony language where they don’t have

⏹️ ▶️ Ben Cohen to put that many keywords. And sometimes those two things can be intention, and that’s something that

⏹️ ▶️ Ben Cohen the community I think even with

⏹️ ▶️ Ben Cohen concurrency, right, the strict checking mode, the goal there is to have the compiler help you

⏹️ ▶️ Ben Cohen work through exactly what you’re trying to express. And so

⏹️ ▶️ Ben Cohen sometimes we do have to resolve that tension, and that’s really the game of language design, is making sure

⏹️ ▶️ Ben Cohen that we keep that vision of having Swift be as low ceremony as possible, but

⏹️ ▶️ Ben Cohen not any lower than that, right? Because if you have like no ceremony, language

⏹️ ▶️ Ben Cohen where it’s really difficult to understand exactly what the code

⏹️ ▶️ Ben Cohen is doing. If you have too much ceremony, then you get a language more like Java

⏹️ ▶️ Ben Cohen where you have to write multiple different things to achieve the same result that

⏹️ ▶️ Ben Cohen in Swift would just be like a couple of words. So yeah, it’s plotting that path and that’s

⏹️ ▶️ Ben Cohen actually something that we think Swift hits the spot of, which is why we think it would be such a

⏹️ ▶️ Ben Cohen great language app development ecosystem, and

⏹️ ▶️ Ben Cohen expand into other places where people want the performance of a

⏹️ ▶️ Ben Cohen head of time compiled language that doesn’t have garbage collection, whilst also giving you the

⏹️ ▶️ Ben Cohen ability to have a joyful experience writing code where you don’t have to write that much code and you don’t have to fit too much stuff in your

⏹️ ▶️ Ben Cohen head at once.

⏹️ ▶️ John Peter Schiff Still hanging on to that dream of Swift being the language that spans from the lowest level of the operating

⏹️ ▶️ John system up to scripting. but obviously

⏹️ ▶️ John a lot of the programmers who are your target audience are Apple employees. How do you work

⏹️ ▶️ John with the other teams at Apple when it comes to language features? How does that work? So, just give an example,

⏹️ ▶️ John like result builders for the SwiftUI thing, non-copyable types, Objective-C interop,

⏹️ ▶️ John like, do you come to them and say, hey, we think I have an idea? Do they come to you? Like, what

⏹️ ▶️ John is the interaction with the rest of Apple for language features? Language features that will obviously, they will benefit everybody when they

⏹️ ▶️ John get out there in the world, but sometimes you look at them, you’re like, okay, that was a language feature that was made specifically for teams

⏹️ ▶️ John at Apple so they could adopt Swift faster or whatever?

⏹️ ▶️ Ben Cohen I mean, I think the way I would think about it is that no feature is ever good unless you use it. So

⏹️ ▶️ Ben Cohen when we’re developing a feature, we really need to use, we really need to do

⏹️ ▶️ Ben Cohen that development with somebody who is directly using that feature. And ideally, you do

⏹️ ▶️ Ben Cohen that development in real time. And so when we’re working with

⏹️ ▶️ Ben Cohen a team like the Swift UI team, We really want to know that something like result builders is really

⏹️ ▶️ Ben Cohen going to hit the spot of them being able to create that really expressive API and

⏹️ ▶️ Ben Cohen develop that feature with them and have them use it and give us feedback in real

⏹️ ▶️ John time. Are you bringing result builders to them? Or are they bringing the idea of the Swift UI to you and saying, we

⏹️ ▶️ John need a generic system to do this? Like, how is that?

⏹️ ▶️ Casey And I don’t think Swift UI in particular

⏹️ ▶️ Casey, John is not. Right.

⏹️ ▶️ John Or any other.

⏹️ ▶️ John, Ben Cohen So another

⏹️ ▶️ Ben Cohen example would be embedded Swift. So obviously, we’ve got a lot of material this week.

⏹️ ▶️ Ben Cohen and we’ve been putting it up actually prior to this week, encouraging people to check out Embedded Swift and

⏹️ ▶️ Ben Cohen use it for developing for the Raspberry Pi Pico or the Playdate or something like that.

⏹️ ▶️ Ben Cohen But we also developed it in conjunction with some of our developers who are working

⏹️ ▶️ Ben Cohen on things like the Secure Enclave. And we’ve talked about that’s actually one of the places where we’ve adopted

⏹️ ▶️ Ben Cohen it this year. And so we directly work with them and they inform our thinking

⏹️ ▶️ Ben Cohen mode. And it really ends up being a better product. I think if we developed

⏹️ ▶️ Ben Cohen the language ahead of time and then said, here it is, we knew you needed to do some firmware development,

⏹️ ▶️ Ben Cohen here’s a language that does it, we would not get as good a result.

⏹️ ▶️ John Paul Shooks And another example of SwiftUI is like the old limitation for the parameter

⏹️ ▶️ John things. You get one through 10 or whatever, and it was in parameter packs or whatever thing that goes around that. Was that an example of like,

⏹️ ▶️ John okay, well you obviously didn’t have that language because they rolled out SwiftUI anyway or whatever,

⏹️ ▶️ John and why was the limitation? There was a language limitation. Then you could look at that and say,

⏹️ ▶️ John all right, well, our language is failing the team here. How can we solve that, but not

⏹️ ▶️ John just by hard coding a thing for SwiftUI, but adding a language feature that now is beneficial

⏹️ ▶️ John to anybody who wants to use it. But as a side effect, that limitation in SwiftUI is gone.

⏹️ ▶️ Holly Borla Yeah, so parameter packs specifically were a generics feature that I think we always knew we

⏹️ ▶️ Holly Borla wanted to have, because there are such a wide variety of use cases for them. And

⏹️ ▶️ Holly Borla SwiftUI View Builder is not the only API that adopted parameter packs last year. You also see it in Foundations

⏹️ ▶️ Holly Borla Predicate API. You see it in WeatherKit APIs. Because there’s a lot of APIs that

⏹️ ▶️ Holly Borla are structured like that where you have a variable number of things that you pass in, and then you get the same variable number of things

⏹️ ▶️ Holly Borla as your output there. But I hope a lot of people try to express

⏹️ ▶️ Holly Borla something in Swift every day across a wide variety of framework teams, people writing apps, people

⏹️ ▶️ Holly Borla on the forums. And one really important job of my team, the language team,

⏹️ ▶️ Holly Borla is to take, see all of these different use cases that people have, and

⏹️ ▶️ Holly Borla first and foremost, help them use the language as it is today. In a lot of cases, people are just trying to use some feature that already exists,

⏹️ ▶️ Holly Borla and they need some help figuring out how to exactly make it work for their specific use case.

⏹️ ▶️ Holly Borla And in cases where there is an expressivity limitation in the language,

⏹️ ▶️ Holly Borla we take all of these different use cases, again, from a variety of different sources. We use the forums as a big

⏹️ ▶️ Holly Borla source of use cases for different things as well. Macros are a really great example of

⏹️ ▶️ Holly Borla this. There were a variety of different use cases for frameworks at Apple.

⏹️ ▶️ Holly Borla Swift Data adopted macros. The new Observation library from last year

⏹️ ▶️ Holly Borla as part of the Swift Standard Library uses macros. But there were also a ton of use cases spinning up on the forums

⏹️ ▶️ Holly Borla about people who were wanting to do really similar things in their code. And something that was

⏹️ ▶️ Holly Borla awesome during the review process of macros in Swift Evolution was people

⏹️ ▶️ Holly Borla were trying it out and putting up example macro packages on GitHub.

⏹️ ▶️ Holly Borla And that also was a really great example of people actually trying out the feature and seeing how it worked

⏹️ ▶️ Holly Borla for them at the same time that it was being developed. And that turned into real feedback that

⏹️ ▶️ Holly Borla was incorporated into the design. So yeah, usually the way that these things work out,

⏹️ ▶️ Holly Borla unless there’s some big overarching goal like data safety. That was a goal that was driven by us.

⏹️ ▶️ Holly Borla But a lot of times it’s that we’re helping so many different people use the language in a variety of different

⏹️ ▶️ Holly Borla ways, and we can generalize these expressivity limitations

⏹️ ▶️ Holly Borla into a single language feature that works for everybody. It’s

⏹️ ▶️ Holly Borla a really interesting process.

⏹️ ▶️ Ben Cohen Parameter packs is actually, I think, an example where we really feel like we’re successfully

⏹️ ▶️ Ben Cohen doing what we try to do, which is have this progressive disclosure where we have these really advanced language

⏹️ ▶️ Ben Cohen features that ultimately are able to produce APIs, help

⏹️ ▶️ Ben Cohen people produce APIs, that you would not know you’re using these advanced features when you use them day to day. You do not know

⏹️ ▶️ Ben Cohen when you go create a view with 11 things in it, that actually that is only possible because of parameter packs.

⏹️ ▶️ Ben Cohen You don’t know that when you’ve got this really nice API where you tell the weather API to give you

⏹️ ▶️ Ben Cohen type values, then instead of giving you two untyped values like in

⏹️ ▶️ Ben Cohen any type value that you used to have before, you immediately get these two strongly typed values

⏹️ ▶️ Ben Cohen where you get code completion on exactly the types that you have that

⏹️ ▶️ Ben Cohen make it so much easier to use. Macros is another example where the creation

⏹️ ▶️ Ben Cohen of macros was general enough that people were able to create these great new APIs that you do not have to think

⏹️ ▶️ Ben Cohen about when you’re using them. design of other

⏹️ ▶️ Ben Cohen testing frameworks. And one of the beautiful things about Swift

⏹️ ▶️ Ben Cohen testing is that you write just regular expressions. Sorry, I shouldn’t

⏹️ ▶️ Ben Cohen, Casey say regular. Especially not with the

⏹️ ▶️ Ben Cohen, Marco problem. Wrong term.

⏹️ ▶️ Ben Cohen You can’t say that you’re wrong. You write ordinary expressions, ordinary Swift expressions like a

⏹️ ▶️ Ben Cohen is not equal to nil or something like that. You put them inside a pound expect, and

⏹️ ▶️ Ben Cohen then the pound expect macro will do some magic stuff under the hood to do reflection actually exactly similar

⏹️ ▶️ Ben Cohen to what you were talking about where it breaks down the object and looks at all the different properties. We don’t have diffing quite yet. That’s a great idea

⏹️ ▶️ Ben Cohen to maybe bring to

⏹️ ▶️ Ben Cohen, John the Swift forums

⏹️ ▶️ Ben Cohen and talk about.

⏹️ ▶️ Ben Cohen, John It’s a good direction. You

⏹️ ▶️ John just look at any other testing framework. I’m pretty sure they know it exists. Fair enough. That’s the thing with testing frameworks.

⏹️ ▶️ John There’s so many of them. There’s so much prior art. Nexe test was a little bit crusty. But you’re spoiled

⏹️ ▶️ John for choice. You just look at all the popular languages and all the testing frameworks. And you’ve chosen this time not to go with a bunch of words with

⏹️ ▶️ John dots between them. But some people like that. So I predict that Swift testing, it

⏹️ ▶️ John looks like a great advancement over what came before. but I feel like testing frameworks are difficult to get right

⏹️ ▶️ John on the second or third try. So going beyond XC test is great.

⏹️ ▶️ Casey We actually had planned to talk to the both of you about more about Swift testing, but in interest of time, I wanted to give,

⏹️ ▶️ Casey or we wanted to give you guys a couple of the floor to answer a couple of softball questions.

⏹️ ▶️ Casey First of all, I’m gonna start a little bit negative and then we’re gonna end with a positive. Is

⏹️ ▶️ Casey there any misunderstanding? It’s more of a curve ball. Yeah, right, I actually have a statement. No,

⏹️ ▶️ Casey I don’t know supports metaphor. Is there any common misunderstanding in the community that

⏹️ ▶️ Casey maybe grinds your gears or you just feel bad, like I’m trying to make this not so negative, like you just feel bad that

⏹️ ▶️ Casey people just haven’t grokked that, oh, all of us, myself maybe included, think A, but

⏹️ ▶️ Casey it’s actually Z, or whatever the case may be. And maybe there isn’t anything, but if you had, let’s

⏹️ ▶️ Casey say, a couple of minutes to correct some common misunderstanding, is there anything

⏹️ ▶️ Casey that jumps to mind? About Swift, not just

⏹️ ▶️ Holly Borla the one. Yeah, there is one immediate one that comes to mind. People in Swift love protocols.

⏹️ ▶️ Holly Borla Protocols are great. I love protocols, too. But a lot of people, when they’re starting to write

⏹️ ▶️ Holly Borla an app, they start by adding a protocol into their code. And then they end

⏹️ ▶️ Holly Borla up using a lot more abstraction than they really needed to in their code.

⏹️ ▶️ Holly Borla Like, they end up using any types, or if you’re familiar with the formal term, existential types, which

⏹️ ▶️ Holly Borla we try to steer people away from, because those are a really complicated feature. and understanding why they have

⏹️ ▶️ Holly Borla some of the behaviors they have is really, really nuanced and hard for a lot of

⏹️ ▶️ Holly Borla people to grasp. And in a lot of cases, you don’t need them. So I would

⏹️ ▶️ Holly Borla tell people to start with a concrete type, start with a struct specifically, until you need more abstraction

⏹️ ▶️ Holly Borla or you need reference semantics and then sort of evolve from there. The same thing is true

⏹️ ▶️ Holly Borla of global variables. I’ve seen so many people write static variables that never change

⏹️ ▶️ Holly Borla throughout their code base. So I would tell people to start with the let. And that’s really helpful for data rate safety

⏹️ ▶️ Holly Borla as well.

⏹️ ▶️ John Yeah. I blame, what is it? Maybe you know protocol-oriented programming. Remember that

⏹️ ▶️ John, Casey old WWDC session? I

⏹️ ▶️ John was

⏹️ ▶️ John, Casey thinking the same thing. A lot

⏹️ ▶️ John of people went to that session and were like, protocols, they’re

⏹️ ▶️ John, Ben Cohen the future.

⏹️ ▶️ Ben Cohen I’m starting every app with protocols. It’s worth re-watching that talk. What the talk said was, if you’re

⏹️ ▶️ Ben Cohen thinking about creating a subtyping relationship, instead of a class hierarchy, start with the protocol. Unfortunately, what people heard was,

⏹️ ▶️ Ben Cohen start with the protocol.

⏹️ ▶️ John It’s right in the title. You just read the title, and they’re like, great. I’m on board.

⏹️ ▶️ John, Ben Cohen It’s just the right tool for everything.

⏹️ ▶️ Ben Cohen It gets to that point where it’s kind of like the black box. Why don’t they make the entire plane out of protocols? That’s

⏹️ ▶️ Ben Cohen not what you want. You want to start from structs, like Holly said, and then generalize

⏹️ ▶️ Ben Cohen your problem when you find you need to

⏹️ ▶️ Ben Cohen, John generalize

⏹️ ▶️ Ben Cohen, Casey it.

⏹️ ▶️ Ben Cohen, John That’s actually a sound program to

⏹️ ▶️ John do, though. They generalize it from the start.

⏹️ ▶️ Casey Yeah, that’s really good advice. And then finally, because we really are running low on time, what are you proud of lately?

⏹️ ▶️ Casey I mean, obviously, there’s obvious answers, like Swift concurrency and the strict

⏹️ ▶️ Casey concurrency. It’s an incredible land. and you should be proud of that, but is there maybe something that,

⏹️ ▶️ Casey you know, your pet feature or project or what have you that maybe not a lot of people have seen? Like Embedded Swift is a great

⏹️ ▶️ Casey example that, I mean, I’ve seen a lot of this on the WWDC session titles anyway, but is there something

⏹️ ▶️ Casey maybe a little more esoteric or just your pet thing that you’re really, really into that you’re proud of?

⏹️ ▶️ Ben Cohen I don’t know if it’s esoteric, but I think we’re pretty proud of the progress we’ve made around cross-platform support.

⏹️ ▶️ Ben Cohen, Casey That’s a good

⏹️ ▶️ Ben Cohen one. And that’s especially something that we’ve been pushing this year. We have support for more distros this year.

⏹️ ▶️ Ben Cohen we have now Debian and Fedora. We’ve been working with

⏹️ ▶️ Ben Cohen the community on creating this really great plugin for VS Code that allows you to use

⏹️ ▶️ Ben Cohen VS Code, if that’s what you’re into. Personally, I’m sticking with Xcode, but like I know a lot of people have

⏹️ ▶️ Ben Cohen very personal preferences. We also have some articles up on how to integrate code completion into

⏹️ ▶️ Ben Cohen NeoVim and Emacs, if that’s your jam as well. So I think we’ve made really some really

⏹️ ▶️ Ben Cohen great progress And we’ve seen both internally and

⏹️ ▶️ Ben Cohen in the outside community a lot of more rapid adoption of Swift on Linux environments

⏹️ ▶️ Ben Cohen and on the server generally. I think if you saw some discussion in the keynote

⏹️ ▶️ Ben Cohen to the fact that we’re now running Swift on the server to do some of the new Apple intelligence features. And that’s

⏹️ ▶️ Ben Cohen all built on this foundation that we’re working on for years with projects like the Swift Neo framework

⏹️ ▶️ Ben Cohen and things like that, that have always given us this ability that

⏹️ ▶️ Ben Cohen have this really great ability to, again, have this high-level language

⏹️ ▶️ Ben Cohen that we feel is really enjoyable to write, but that manage to get you, in the case of the server, really

⏹️ ▶️ Ben Cohen low memory footprints, which can be a big challenge when it comes to

⏹️ ▶️ Ben Cohen large server farms especially. And that’s been a really big win for us that we’re pretty proud of. Paul

⏹️ ▶️ Ben Cohen Krugman World domination, still on

⏹️ ▶️ John the table. Still on the table.

⏹️ ▶️ Casey How about you, Holly?

⏹️ ▶️ Holly Borla data rate safety in SOS 6. I’m personally really proud of my team,

⏹️ ▶️ Holly Borla because a lot of the team was new to the data rate safety model and the concurrency model in

⏹️ ▶️ Holly Borla general. At the beginning of this year, originally,

⏹️ ▶️ Holly Borla it was built by a smaller group of engineers, and then more people got involved in concurrency.

⏹️ ▶️ Holly Borla So yeah, I’m really proud of the work that the team has put in in general into this release.

⏹️ ▶️ Holly Borla And I’m also really excited by how the community

⏹️ ▶️ Holly Borla has started to adopt these features and surface feedback to us and talk about what’s difficult,

⏹️ ▶️ Holly Borla talk about what error messages are confusing, and sort of seeing the community really

⏹️ ▶️ Holly Borla embrace this new model of programming and come to a shared understanding

⏹️ ▶️ Holly Borla and improve both the compiler and the documentation and the language.

⏹️ ▶️ Holly Borla I’m really excited to see where this goes from here.

⏹️ ▶️ Casey That’s awesome. Ben Cohen, thank you so much for joining us. I really appreciate it. Thank you very much. Borla,

⏹️ ▶️ Casey thank you so very, very much to both of you guys. We really, really appreciate it.

⏹️ ▶️ Holly Borla Thank you so much for having us.

⏹️ ▶️ Casey And thank you to Apple for hosting. And with that, I think we’re good.

⏹️ ▶️ Marco See you next week.