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.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
200
AsyncSequenceとAsyncStreamのプロポーザルを全部読む!!
s_shimotori
1
530
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
460
おっと、お飲みごろの時間です!
s_shimotori
1
180
Synchronizationを支える技術
s_shimotori
1
340
英語
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
870
Other Decks in Programming
See All in Programming
AI Agent時代のリアーキテクチャ戦略と実践
hokaccha
9
5k
UPDATE をやめる — EF Core でマスタをバージョン管理する
panda728
PRO
0
810
動作中のプログラムの中身をリアルタイムに覗く / Realtime Debugger for CSharp with Roslyn
prota
1
1.4k
大喜利で理解するLLM as a Judge / Understanding LLM-as-a-Judge through Ogiri
rockname
0
170
手動確認はもう限界 〜XCUITestでCustom URL Schemeの遷移を起動種別ごとに自動テストする〜 / Testing Custom URL Schemes with XCUITest
otouto
0
350
ハーネス設計入門 〜 基礎知識の整理から実務へのステップアップ 〜
kinopeee
18
17k
技術的負債を組織課題として解く-増えすぎたマイクロサービスとの戦い-
reimaru
1
2.4k
setup-vp GitLab対応の裏側
naokihaba
0
130
海上で動くGoサーバー: goroutineとchannelでさばく航行データストリーム
atsuki_seo
0
960
MCP Appsでつくるチャット駆動な地図アプリ
nakamori1024
0
100
iOSDC Japan 2026 - Swiftで作って学ぼう!データベース自作入門
kaseken
2
360
The Good Stuff, Not the Slop: Engineering High-Quality Android Apps with Modern AI Tooling
danybony
1
260
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
The Cost Of JavaScript in 2023
addyosmani
55
10k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
290
Scaling GitHub
holman
464
140k
A Soul's Torment
seathinner
8
3.6k
Ethics towards AI in product and experience design
skipperchong
2
380
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Paper Plane (Part 1)
katiecoart
PRO
2
11k
A better future with KSS
kneath
240
18k
Chasing Engaging Ingredients in Design
codingconduct
0
340
AI: The stuff that nobody shows you
jnunemaker
PRO
10
1.1k
Navigating the Design Leadership Dip - Product Design Week Design Leaders+ Conference 2024
apolaine
2
450
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