Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Swift Updates - Learn Languages 2025
Search
Yuta Koshizawa
September 06, 2025
Programming
840
2
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Swift Updates - Learn Languages 2025
Strict Concurrency Checkingを中心に、前回2021年からのSwiftのアップデートについて説明します。
Yuta Koshizawa
September 06, 2025
More Decks by Yuta Koshizawa
See All by Yuta Koshizawa
Heart of Swift Concurrency
koher
0
1.4k
How Swift's Type System Guides AI Agents
koher
0
500
Swiftのstructとイミュータビリティ
koher
4
820
Swift 6のTyped throwsとSwiftにおけるエラーハンドリングの全体像を学ぶ
koher
4
6.5k
Swift Concurrency時代のiOSアプリの作り方
koher
15
9.9k
Swift Zoomin' #8
koher
2
730
async/awaitやactorでiOSアプリ開発がどう変わるか Before & Afterの具体例で学ぶ
koher
9
8k
Swift Language Updates - Learn Languages 2021
koher
8
1.9k
先取り! Swift 6 の async/await
koher
15
4.2k
Other Decks in Programming
See All in Programming
気持ちぃ〜角丸 Squircle
ryu1013
0
320
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
2
1k
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
Agents on Rails - Rails at Scale 2026
irinanazarova
0
570
現場と育てるRailsモデリング 〜Spreadsheetから始めたモデル設計〜
siroemk
2
650
Lambda durable functionsでHuman in the Loopを楽に…楽に……
har1101
0
130
Jetpack Compose Mechanisms
skydoves
3
830
sbt 2.0: takeoff
eed3si9n
0
160
[2026-09-26]空論ジェネリックプロセス~テスト資産とAIで紡ぐ、再現可能なパフォーマンスチューニングの話~
tosite
0
270
ChromeでローカルLLM
ryu1013
0
140
作れる、でも消せるか?──安全に「枯らして消す」機能削除術 / Drain, Then Delete
chobishiba
2
820
設計次第でAIコードの読む量は減らせる / designing-for-code-reading
minodriven
35
17k
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
1
3.4k
What's in a price? How to price your products and services
michaelherold
247
13k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
My Coaching Mixtape
mlcsv
0
360
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
480
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
69
67k
Ethics towards AI in product and experience design
skipperchong
2
440
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
790
Fireside Chat
paigeccino
43
4.1k
Paper Plane
katiecoart
PRO
5
54k
Code Review Best Practice
trishagee
74
20k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Transcript
Swi$ Yuta Koshizawa @koher
2021 : Swi) 5.5 2025 : Swi) 6.2
Swi$ 5.5ͰSwi$ ConcurrencyΛಋೖ Swi$ Concurrencyͱɺฒߦॲཧؔ࿈ͷػೳ܈
4ؒͰ࠷େͷΞοϓσʔτ Swi% 6ͷϦϦʔεʢ2024ʣ
Ұ൪Өڹ͕େ͖͔ͬͨͷ Strict Concurrency Checking
σʔλڝ߹Λى͜͠ಘΔίʔυ ↓ ⛔ ίϯύΠϧΤϥʔ
ίϯύΠϧ͕௨Δ ↓ ✅ σʔλڝ߹͕ى͜Βͳ͍
Strict Concurrency Checking
Swi$ 6Ͱ Pure Swi)ͰunsafeͳߏจΛΘͳ͚Ε Swi)ͷίʔυσʔλڝ߹Λى͜͞ͳ͍
σʔλڝ߹ͱʁ ෳͷεϨου͔Βಉ͡ϝϞϦྖҬʹಉ࣌ʹΞΫηε͠ɺগͳ͘ ͱͦͷҰ͕ͭॻ͖ࠐΈͰ͋Δͱ͖ʹى͜Δݱ
σʔλڝ߹͕ى͜Δͱ • ະఆٛಈ࡞ • σʔλෆ߹ • Ϋϥογϡ • …
σʔλڝ߹ʹΑΔόάʹରॲͮ͠Β͍ • Λ࠶ݱ͢Δ͜ͱ͕ࠔ • ݪҼ͕σʔλڝ߹Ͱ͋Δͱಥ͖ࢭΊΔͷ͕ࠔ • ίʔυΛमਖ਼ͯ͠ղܾ͞Εͨ͜ͱͷ֬ೝ͕ࠔ
σʔλڝ߹ΛػցతʹࢭͰ͖Δͱ͏Ε͍͠
ݪҼෆ໌ͷΫϥογϡͷ΄ͱΜͲ͕ σʔλڝ߹ʹΑͬͯҾ͖ى͜͞Ε͍ͯͨྫ
ίϯύΠϥ͕ͲͷΑ͏ʹͯ͠ σʔλڝ߹Λ͙ͷ͔
Swi$ίϯύΠϥ ܕΛͬͯσʔλڝ߹Λ͙
Swi$ܕΛݫ֨ʹѻ͏ݴޠ
2014ͷϦϦʔεॳ͔Βnull safetyΛ࣋ͭ let values = [2, 3, 5, 7] print(values.first
+ 1) // ⛔ ίϯύΠϧΤϥʔ
2014ͷϦϦʔεॳ͔Βnull safetyΛ࣋ͭ let values = [2, 3, 5, 7] if
let first = values.first { print(first + 1) // ✅ OK: 3 }
֤ݴޠͰͷ Op$onal / Nullable Type • Kotlin: String? • Python:
str | None • TypeScript: string | null | undefined • ...
Swi$͕ܕΛͬͯ σʔλڝ߹Λ͙ͷSwi$Β͍͠
Ωʔϫʔυ Isola&on Domain ͱ Sendable
Isola&on Domainͱ • Swi%ͷϓϩάϥϜෳͷIsola+on Domainʹׂ͞ΕΔ • ͯ͢ͷॲཧ͍ͣΕ͔ͷIsola+on Domain্Ͱ࣮ߦ͞ΕΔ • ҰͭͷIsola+on
Domain্Ͱɺಉ࣌ʹҰͭͷॲཧ͔࣮͠ߦ͞Ε ͳ͍
⚠ Isola'on DomainεϨουͰͳ͍ ్த·ͰεϨουAͰ࣮ߦ͞Ε ଓ͖͕εϨουBͰ࣮ߦ͞Εͯྑ͍
Isola&on Domainͱ • Swi%ͷϓϩάϥϜʹෳͷIsola+on Domainʹׂ͞ΕΔ • ͯ͢ͷॲཧ͍ͣΕ͔ͷIsola+on Domain্Ͱ࣮ߦ͞ΕΔ • ҰͭͷIsola+on
Domain্Ͱɺಉ࣌ʹҰͭͷॲཧ͔࣮͠ߦ͞Ε ͳ͍
ͲͷΑ͏ͳσʔλ ୯ҰͷIsola&on DomainͰѻ͍ͬͯΔݶΓ σʔλڝ߹ΛҾ͖ى͜͞ͳ͍
ෳͷIsola&on DomainͰ σʔλΛڞ༗͍ͨ͠ͱ͖ʁ
ෳIsola&on DomainͰڞ༗ͯ҆͠શͳܕͱ ҆શͰͳ͍ܕΛ۠ผ͢Δ
ෳIsola&on DomainͰڞ༗ͯ҆͠શͳܕ Sendable
ΠϛϡʔλϒϧΫϥεڞ༗͞Εͯ҆શ final class Foo: Sendable { // Sendable४ڌՄ let value:
Int // ෆม init(value: Int) { self.value = value } } ΠϛϡʔλϒϧΫϥεঢ়ଶ͕มߋ͞Εͳ͍ͷͰɺෳͷ Isola&on DomainؒͰڞ༗ͯ͠σʔλڝ߹ͷݪҼͱͳΒͳ͍
ϛϡʔλϒϧΫϥεڞ༗͞ΕΔͱ҆શͰͳ͍ final class Foo: Sendable { // ίϯύΠϧΤϥʔ var value:
Int // Մม init(value: Int) { self.value = value } } ෳͷIsola&on Domain͔Βಉ࣌ʹΞΫηε͞Εͨͱ͖ʹσʔλڝ ߹ͷݪҼͱͳΓಘΔͷͰ Sendable ४ڌͰ͖ͳ͍
ϩοΫͰอޢ͢ΕϛϡʔλϒϧΫϥεͰ҆શ final class Foo: Sendable { // Sendable४ڌՄ private let
lock: OSAllocatedUnfairLock<Int> var value: Int { get { lock.withLock { $0 } } set { lock.withLock { $0 = newValue } } } init(value: Int) { self.lock = .init(initialState: value) } }
ܕڞ༗͞Εͣίϐʔ͞ΕΔͷͰ҆શ struct Foo: Sendable { // ✅ Sendable४ڌՄ var value:
Int // Մม init(value: Int) { self.value = value } }
ActorݸʑͷIsola*on DomainΛ࣋ͭͷͰ҆શ actor Foo { // ҉తʹSendable४ڌ var value: Int
// Մม init(value: Int) { self.value = value } } ActorݸʑͷΠϯελϯε͕Isola*on DomainΛܗ͠ɺॴଐ͢ Δίʔυ͕ݸʑͷIsola*on Domain্Ͱ࣮ߦ͞ΕΔ
final class Foo { // non-Sendable var value: Int =
42 } actor A { func useFoo(_ foo: Foo) { print(foo.value) // σʔλڝ߹Λى͜͠ಘΔ } } let foo = Foo() let a = A() await a.useFoo(foo) // ⛔ ผͷIsolation Domainʹͤͳ͍ foo.value += 1 // σʔλڝ߹Λى͜͠ಘΔ
struct Foo: Sendable { var value: Int = 42 }
actor A { func useFoo(_ foo: Foo) { print(foo.value) // σʔλڝ߹Λى͜͞ͳ͍ } } let foo = Foo() let a = A() await a.useFoo(foo) // ✅ ผͷIsolation DomainʹͤΔ foo.value += 1 // σʔλڝ߹Λى͜͞ͳ͍
None
ܕͷ Sendable ४ڌΛར༻ͯ͠ ίϯύΠϥ͕σʔλڝ߹Λࢭ
ͦͷଞ
ଟ༷ͳϓϥοτϑΥʔϜͷల։ • Linux • Windows • WebAssembly
ଟ༷ͳ༻్Ͱͷར༻ • αʔόʔαΠυ1 • ϒϥβʢWebAssemblyʣ2 • ΈࠐΈ3 3 ࣄྫ: h%ps:/
/github.com/swi3lang/swi3-playdate-examples 2 ࣄྫ: h%ps:/ /www.youtube.com/watch?v=Q4Tqxe06Pw0 1 ࣄྫ: h%ps:/ /www.swi,.org/blog/swi,-at-apple-migra7ng-the-password-monitoring-service-from-java/
ଟ༷ͳݴޠͱͷ࿈ܞ • C/C++4 • Java5 • JavaScript6 • Python7 7
h$ps:/ /github.com/pvieito/PythonKit 6 h$ps:/ /github.com/swi3wasm/JavaScriptKit 5 h$ps:/ /developer.apple.com/videos/play/wwdc2025/307/ 4 h$ps:/ /www.swi,.org/documenta8on/cxx-interop/
৽͍͠ݴޠػೳ • ϚΫϩ • ॴ༗ݖ • Parameter PacksʢՄมܕύϥϝʔλʣ • InlineArray
ʢݻఆྻʣ • Integer Generic Parameters ʢܕύϥϝʔλʹΛࢦఆʣ • …
·ͱΊ • Swi% 6ͰStrict Concurrency Checking͕ಋೖ • Pure Swi%ͰίϯύΠϥ͕σʔλڝ߹Λશʹࢭ •
ଟ༷ͳϓϥοτϑΥʔϜ༻్ʹల։ • ͦͷଞʹϚΫϩͳͲศརͳ৽ػೳΛՃ
͠Swi$ʹڵຯΛ࣋ͬͨΒ "The Swi) Programming Language"8 ༗ࢤʹΑΔຊޠ൛9͋Γ·͢ 9 h$ps:/ /www.swi,langjp.com/ 8
h$ps:/ /docs.swi/.org/swi/-book/documenta;on/the-swi/-programming-language