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
1人で挑むSwiftコンパイラ 〜型システム入門編〜
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Shigure Shimotori
August 25, 2024
Programming
1.5k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
1人で挑むSwiftコンパイラ 〜型システム入門編〜
https://fortee.jp/iosdc-japan-2024/proposal/7a48c2e8-2a6b-4391-84dd-d543c6c3bf09
Shigure Shimotori
August 25, 2024
More Decks by Shigure Shimotori
See All by Shigure Shimotori
モジュールの視点からSwiftを読み解く #iosdc
s_shimotori
0
390
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
550
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
470
おっと、お飲みごろの時間です!
s_shimotori
1
190
Synchronizationを支える技術
s_shimotori
1
350
英語
s_shimotori
1
1.3k
Parallel Socket Communication in Swift
s_shimotori
1
1.1k
UIColor Anatomy
s_shimotori
1
3.2k
UIColor Cluster
s_shimotori
1
880
Other Decks in Programming
See All in Programming
Optunaを作ったときにやりたかったこと、その後 (2026/10/16, Optuna Meetup #3)
iwiwi
2
930
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
1.2k
GemmaをJevのように使ってみる / Use Gemma like Jev
kishida
5
800
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
3
780
【加筆修正版】Laravel のアプリケーションをどこにデプロイするか #phpcon_ehime
akase244
0
150
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
160
dotNET_vulnclicker_intro.pdf
deka_morita
0
150
[2026-10-14](C)Re:ゼロから始める異世界生活〜始まりの終わりと終わりの始まり〜
tosite
0
110
Compiling a real-world CLI tool to native with Static Hermes
tmikov2023
0
120
Herb in Rails 8.2: Your ERB views, now HTML-aware @ Kaigi on Rails 2026, Tokyo, Japan
marcoroth
2
300
APNsからLive Activityを開始する話
yumnumm
0
170
JAWS-UG 東京支部が始める、JAWS-UG支部コラボ / JAWS-UG lunchtime LT Collaboration
y0hgi
0
280
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing for humans not robots
tammielis
254
26k
Odyssey Design
rkendrick25
PRO
2
880
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
1
630
[Rails World 2026] Durable orchestration on Rails: from continuation to workflow
palkan
1
800
GraphQLとの向き合い方2022年版
quramy
50
15k
Making Projects Easy
brettharned
120
6.8k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
630
Six Lessons from altMBA
skipperchong
29
4.5k
Fantastic passwords and where to find them - at NoRuKo
philnash
53
4k
Art, The Web, and Tiny UX
lynnandtonic
304
22k
[RailsConf 2023] Rails as a piece of cake
palkan
59
7.1k
Transcript
S_Shimotori 1ਓͰΉSwiftίϯύΠϥ ʙܕγεςϜೖฤʙ iOSDC Japan 2024
2 ΈΜͳ͍͜͠ͱΛͯͯ͠ ͍͍͚ͭͯͳ͍……ʂʂ
3
4 omochimetaru. SwiftͷܕਪΛֶ΅͏. 2024, 3.
͓ͪ͞ΜϚδײँ😭 • Θ͔Γ͔ͬͨ͢ʂ • ίϯύΠϥܕਪͷΘ͔Γ͍͢ࢿྉϚδوॏ 5
6 ϚδΘ͔Γ͔ͬͨ͢οεʂ 2019ͷ߹॓ͷ ϋϯζΦϯ͕ݩωλͩΑ ϋϯζΦϯʂʁ ͗͢ΔͷͰʁʁ
7 https://github.com/omochi/SwiftTypeInferenceHandsOn
SwiftTypeInferenceHandsOnͷ͓ • ৯͍ঢ়ଶͷͱ͜ΖΛࣗͰ࣮͠ɺશςετΛύεͰ͖ͨΒΫϦΞ 8 ʙʙதུʙʙ
ςετ͜Μͳײ͡ • ྫɿlet a = 3ͷܕਪ͕͏·͍͔͘͘ͷςετ 9 IntܕͱਪͰ͖ͨΒOKʂ
ͪΐͬͱݹ͍͚Ͳޓੑ͋Δ͔Βฏؾ ❤︎ 10
🤔🤔🤔🤔🤔 11
_InternalSwiftSyntaxParser 12
2019 13 Swift 5.1 Internal Swift Syntax Parser swift-syntax (2019)
SwiftTypeInferenceHandsOn
2024 14 Swift 5.1 Internal Swift Syntax Parser swift-syntax (2019)
SwiftTypeInferenceHandsOn Swift 5.10 ❌
ʲֶͼᶃʳޓੑ͕ͳ͍͜ͱ͋Δ • 2019 • swift-syntax͕ίϯύΠϥಉࠝͷInternal Swift Syntax Parserʹґଘ͍ͯͨ͠ • 2024
• ίϯύΠϥ͔ΒISSP͕औΓআ͔Ε͍ͯΔ 15 5લͷswift-syntaxͱ࠷৽ͷίϯύΠϥͷΈ߹ΘͤͰ͑ͳ͍
࠷৽ͷSwiftSyntaxʹରԠͤ͞·ͨ͠ 16 👈 ͨ͠ʂ
͔͜͜Β͕ຊ൪ʂ 17 ࢦͤʂ
ಓͷΓ͘ݥ͍͠ • ϝιουͷͷൣғ͕Θ͔Βͳ͍ɺͲ͜·Ͱ࣮ͨ͠Β͍͍͔Θ͔Βͳ͍ 18 ʙʙதུʙʙ
ίϯύΠϥͷ࣮ظ݁Ռ͕໌Β͔ʂ • ࣮͖͢ॲཧظ݁Ռ໌Β͔Ͱ͋ΓɺૉʹͦΕΛ࣮͢ΕOK • ϢʔβΠϯλʔϑΣʔεʹ͋Γ͕ͪͳᐆດͳ;Δ·͍ͳ͍ 19
ίϯύΠϥͷ࣮ظ݁Ռ͕໌Β͔ʂ • ࣮͖͢ॲཧظ݁Ռ໌Β͔Ͱ͋ΓɺૉʹͦΕΛ࣮͢ΕOK • ϢʔβΠϯλʔϑΣʔεʹ͋Γ͕ͪͳᐆດͳ;Δ·͍ͳ͍ 20 ζόϦॻ͍ͯ͋ΔΘ͚Ͱͳ͍ ૉਓ͕ϊʔώϯτͰѲ͢Δͷ͍͠ ͩͬͨΒ࣮ػDebug View
Hierarchy͔ΒḷΕͨͷʹ
ʲֶͼᶄʳ࣮ͷղઆΛฉ͖ಀ͢ͳ • ॳ৺ऀ͕ϊʔώϯτͰҰͰ͔ΔΑ͏ʹ࣮͞Ε͍ͯͳ͍…ʂ • ಡΈ͍͢ՕॴΛ୳͢ͷҰۤ࿑ 21
22 Ͱ͖ͨ🎉🎉 ʢͪΐͬͱؒҧ͚ͬͯͨͲʣ
ࣗͰίϝϯτΛॻ͖͠ͳ͕Βղ͍ͨ 23 ※ωλόϨࢭͷͨΊ෬͍ͤͯ·͢
ॴײʢ੍ݶ࣌ؒͷ؍ʣ • ςετͯ͢ύεͰ͖͕ͨɺ͚ͬ͜͏͕͔͔࣌ؒͬͨ • ϚΠϖʔεʹΜͩͷ͋ΓΰʔϧσϯΟʔΫΛফඅͨ͠ • ͠1ധ2ͷ߹॓Ͱઓ͍ͯͨ͠ΒΫϦΞͰ͖ͯͳ͔ͬͨ😢 24
ॴײʢқͷ؍ʣ • ࣗྗͰશ෦ղ͚ͨ🎉ɹҰ෦ؒҧ͚ͬͯͨͲ • ղͱؔͷͳ͍ॴʹ͍͚ͭͯͩͰ୭͔ͱٞͰ͖ͨΒΑ͔͔ͬͨ • ASTͷϊʔυvisitorύλʔϯͳͲݟͲ͜Ζ 25
ʲֶͼᶅʳஸ͍͍՝Λιϩ߈ུ͢Δ • ஸ͍͍қͷ՝͕ݟ͚ͭΒΕΔͱલ͖ʹͳΕΔɺָ͍͠ • ͬ͘͡Γιϩ߈ུͷ࣌ؒΛ࣋ͭͷ˕ 26
·ͱΊ • ؾʹͳΔൃදࢀߟจݙ͍ͯΈΔ • ࢥ͍ͬͯઓ͢Δͱ૾Ҏ্ͷֶͼ͕ಘΒΕΔ • ҰॹʹϋϯζΦϯʹઓͯ͠ΜͰσΟεΧογϣϯ͠Α͏ͥʂ 27
Special Thanks🙇 • ͓ͪϝλϧ͞Μ 28
S_Shimotoriʹ͍ͭͯ • X: S_Shimotori_pub • GitHub: S-Shimotori • ੜଉ: ࣗɺͨ·ʹ౦ژΨʔσϯςϥεلඌҪொ
29
͓·͚
ࢀߟจݙ • SwiftͷܕਪΛֶ΅͏ | Let's Learn About Type Inference in
Swift - Speaker Deck • https://speakerdeck.com/omochi/lets-learn-about-type-inference-in-swift • omochi/SwiftTypeInferenceHandsOn: Swiftc߹॓ 2019/09/28 • https://github.com/omochi/SwiftTypeInferenceHandsOn • Θ͍Θ͍swiftc։ൃ߹॓ at ౬Տݪ ͓ΜͲܙʙܕਪΞϧΰϦζϜΛֶͿʛsonson • https://note.com/sonson/n/n406f129fc993 31
ࢀߟจݙ • swift-syntax/Changelog.md at main · swiftlang/swift-syntax • https://github.com/swiftlang/swift-syntax/blob/main/Changelog.md •
Quick Overview of SwiftParser • https://speakerdeck.com/kitasuke/quick-overview-of-swiftparser • 32
ૉࡐ • ;͖ͩ͠ૉࡐઐαΠτʮϑΩμγσβΠϯʯ – ϑΩμγૉࡐ͕1000Ҏ্ू·ΔαΠτ • https://fukidesign.com/ 33