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
Shigure Shimotori
August 25, 2024
Programming
1.6k
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
420
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
550
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
480
おっと、お飲みごろの時間です!
s_shimotori
1
190
Synchronizationを支える技術
s_shimotori
1
360
英語
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
Zero-Tap Sign-In対応、結局何をすればいいの?
mitohato14
0
1k
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
250
学びを記事・スライド・Xへ高速展開する― AI-assisted Learning Loopで回すコンテンツ生成術
ochtum
0
160
AI主導のプログラミング学習アプリを作ってみた
econanringo
0
200
Performance Optimization With LLMs
xleitix
0
220
Event is what happens
moro
2
1.9k
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
200
続・コーディングルールの鮮度を保ちたい / keep-fresh-go-internal-conventions-again
handlename
0
140
AmebaブログはKMPから卒業します
kmars0605
0
290
Vue.jsで作る空間解析アプリとCapacitorプラグインのData Bridge
hal_spidernight
1
120
Domain-Driven Transformation
hschwentner
2
2.3k
[JA] Domain Modeling with Vanilla Rails: 「操作」から再考するRailsの設計論
yasaichi
4
1.1k
Featured
See All Featured
A designer walks into a library…
pauljervisheath
211
25k
Scaling GitHub
holman
464
140k
The Invisible Side of Design
smashingmag
301
52k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Evolving SEO for Evolving Search Engines
ryanjones
0
340
30 Presentation Tips
portentint
PRO
1
450
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
2
960
The AI Revolution Will Not Be Monopolized: How open-source beats economies of scale, even for LLMs
inesmontani
PRO
3
3.8k
StorybookのUI Testing Handbookを読んだ
zakiyama
31
7k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
280
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