Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
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
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
520
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
440
おっと、お飲みごろの時間です!
s_shimotori
1
170
Synchronizationを支える技術
s_shimotori
1
330
英語
s_shimotori
1
1.3k
Parallel Socket Communication in Swift
s_shimotori
1
1k
UIColor Anatomy
s_shimotori
1
3.1k
UIColor Cluster
s_shimotori
1
860
iOSDC Japan 2019 60 mins for color
s_shimotori
5
4.2k
Other Decks in Programming
See All in Programming
不幸な GC
chencmd
0
870
レビュー履歴をAIに食わせて、 Compose移行を加速するs
shihochan
0
260
信頼性の目標を誰も求めてない
shubox
0
480
Foundry Localでエージェント開発
seosoft
0
110
PyConJP2026_wat_Python × Signal Processing: How to Draw Pictures with Sound Using Spectrogram Art
wat
0
650
Gmail/Google DriveをトリガーにAIエージェントを動かそう! / Run AI agents with Gmail/Google Drive as triggers!
har1101
3
460
tsc.rip を支える技術 / Kyoto.なんか #8
susisu
0
4.2k
コンパウンドプロダクト開発のためのローカルプロセスマネージャー再発明 #layerxgo
izumin5210
0
620
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
110
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
280
20260828_品質と開発生産性を両立させる、AI時代のE2Eテストの考え方
magicpod
0
110
Hono + Inertia + React で LP を構築した話
oukayuka
2
200
Featured
See All Featured
Reality Check: Gamification 10 Years Later
codingconduct
0
2.3k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
Leveraging LLMs for student feedback in introductory data science courses - posit::conf(2025)
minecr
1
370
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
330
Optimizing for Happiness
mojombo
378
71k
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
45k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
390
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Everyday Curiosity
cassininazir
0
310
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.8k
New Earth Scene 8
popppiees
3
2.5k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.8k
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