https://developer.apple.com/videos/play/wwdc2024/10136/
What’s new in Swift - WWDC24 - Videos - Apple Developer
Join us for an update on Swift. We'll briefly go through a history of Swift over the past decade, and show you how the community has...
developer.apple.com
해당 포스트는 위 영상을 기반으로 개인적으로 메모/정리한 글입니다.
개요
What's new in Swift.
Swift over the years
Swift 6 는 개발자들이 올바른 concurrent programs 를 작성할 수 있도록 data-race safety 를 기본으로 보장할 것입니다.
Cross compilation to Linux
Swift build 하나로 리눅스에서도 편하게 돌려보세요.
Swift Testing
Improvements to builds
- Explicitly built modules
- 하나의 모듈을 빌드할 때 사실은 의존 관계 때문에 빌드되는 모듈들이 많음. 이런 빌드 과정과 바이너리 모듈을 명시적으로. 더 가시성있게, 더 예측하기 쉽게, 읽기 쉽게 표현해주겠다. 의존성을 눈으로 확인 가능하기 때문에 컴파일 투명성이 향상된다고 할 수 있다.
- 병렬 빌드 최적화
- 디버거도 빌드된 binary 모듈을 공유할 수 있게 된다. 따라서 디버깅 시작에 걸리는 시간이 더 단축됨 (ex: po [다른 모듈에 의존하는 변수] 를 처음으로 출력)
- Xcode 16 빌드 옵션에서 따로 켜야 함
- 자세한 건 Demystify explicitly built modules 세션에서 다룸
Language updates
- Swift 6. data-race 에 안전한 새로운 언어 모드를 소개합니다
- Noncopyable types
- 카피 불가. 유니크한 소유권을 가지게 하는 타입. 리소스 leak 방지에도 좋다.
- ex) struct File: ~Copyable 을 통해 하나의 파일에 동시에 접근할 수 없게 보장한다
- 자세한 건 Consume noncopyable types in Swift 세션에서 다룸
- Embedded Swift
- 새로운 language subset
- Small and standalone binaries
- 임베디드 프로그래밍처럼 메모리, 성능이 제한된 환경에서도 이제 Swift 를 써보세요
- C++ interoperability
- Typed throws
- throw 할 에러 타입을 미리 정의할 수 있다
- catch 절을 포함해서 코드가 명료해지지만 유연성은 떨어짐
- Data-race safety
- 이제 Data-race safety 는 디폴트가 되고 Swift 6 로 업데이트 시 기본으로 data-race 오류를 compile time error 로 알려주겠다
'WWDC > 2024' 카테고리의 다른 글
Demystify explicitly built modules (추천세션!) (0) | 2024.08.08 |
---|---|
Migrate your app to Swift 6 (추천세션!) (0) | 2024.08.08 |
Consume noncopyable types in Swift (0) | 2024.08.08 |
A Swift Tour: Explore Swift’s features and design (0) | 2024.08.07 |
What’s new in App Store Connect (0) | 2024.08.07 |