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
展望 Swift 4
Search
Johnlin
August 16, 2016
Programming
130
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
展望 Swift 4
Johnlin
August 16, 2016
More Decks by Johnlin
See All by Johnlin
用 MLIR 實作 一個 Ruby IR (intermediate representation)
johnlinvc
0
320
Unearth Ruby builtin Gems 發掘 Ruby 的內建 Gems
johnlinvc
0
400
Ruby 型別檢查工具簡介
johnlinvc
0
630
Swift Actor 實作探索
johnlinvc
0
200
用 mruby 來寫跨平台工具
johnlinvc
0
130
Actor model 簡介
johnlinvc
0
240
一起玩 Helm 3
johnlinvc
1
160
為什麼 App 卡卡的
johnlinvc
2
1.3k
如何使用 byebug 來除錯 Ruby 程式
johnlinvc
0
270
Other Decks in Programming
See All in Programming
源内ハンズオン概要編
hideg
0
190
リアルな遅延を測る仕様
kota_yata
1
120
自動化したのに回らない テスト運用の壁―AI時代の品質責任と生産性
mfunaki
0
320
Go言語とトイモデルで学ぶTransformerの気持ち / fukuokago23-transformer
monochromegane
0
190
Building a Meta Ray-Ban display app
akkeylab
0
170
PostgreSQL 18で考えるUUID主キー
kazuhiro1982
0
480
【QA Test Talk Vol.8】AI-DLC による Whole Team Approach の加速
pkshadeck
PRO
0
210
改善しないと、タスクが回らない。 “てんこ盛りポジション” を引き継いだ情シスの、入社3ヶ月の業務改善録
krm963
0
280
5分で問診!Composer セキュリティ健康診断
codmoninc
0
1.1k
いまどきの Codex で開発する visionOS アプリの開発スタイルについて
karad
0
150
バグを直したら useEffect が消えた
colorful12
3
650
ドリフトを絶対に許さない(?)CDK運用 / CDK Ops with Zero Tolerance for Drifts (?)
akihisaikeda
1
210
Featured
See All Featured
Building Adaptive Systems
keathley
44
3.2k
Bioeconomy Workshop: Dr. Julius Ecuru, Opportunities for a Bioeconomy in West Africa
akademiya2063
PRO
1
250
It's Worth the Effort
3n
188
29k
Raft: Consensus for Rubyists
vanstee
141
7.6k
Keith and Marios Guide to Fast Websites
keithpitt
413
23k
The browser strikes back
jonoalderson
0
1.5k
Optimising Largest Contentful Paint
csswizardry
37
3.9k
Amusing Abliteration
ianozsvald
1
250
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.2k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4.5k
We Have a Design System, Now What?
morganepeng
55
8.3k
Navigating the moral maze — ethical principles for Al-driven product design
skipperchong
2
490
Transcript
ల Swift 4 John Lin @johnlinvc
ճސSwift 3 • Swift 3 ။ੋҰݸత൛ຊɻ • ౸લҰڞ༗88 ݸमվɻ
Open source ඇৗ • ೳⴺᡉू༗࠽ೳత֤Ґ • ᦒવਐఔຫɼୠੋೳ㗞ग़ߴ࣭త݁Ռ
[։ݯ]ೈᱪ࣌ఔ༬ဟ • • ༗Ұࠣඪᔒ༗ୡ • ඪෆੋঝɼᔒୡՄҎࡏྗ
ᡉযࡏॏᴍ • ༗త࣌ީଠଟࣄᚙੜɼᔒ㭎๏ಉ᮫࣌
धཁ໌֬తඪ • Ұ։࢝(12݄౸1݄) Swift 3 ᔒ༗໌֬తඪɻ • ޙိ༗໌֬తඪޙࣄबॱརଟྃ
ෆՄೳᩋ㑌ݸਓ։৺ • 㑌ݸܾఆ༗ࠣਓتᓣɼ༗ࠣਓෆتᓣɻ • แؚࣄతઌޙॱংɼੋ൱धཁࠣޭೳ • https://github.com/apple/swift-evolution/blob/ master/commonly_proposed.md
։ᚙܭᙘ • 2016 : Swift 3.0 • 2017 य़ఱ: Swift
3.x • 2017 ळఱ: Swift 4 • ଖத။ἥᎎ bugfix release ૾ੋ 3.0.1
Swift 4 • Swift 4 ሡ။ၷݸ։ᚙ֊ஈ
ୈҰ֊ஈ • ሢࡏఔࣜᛰ ABI తᜦఆɻ؆ᄸိ㘸बੋ૬༰ ੑɻ • Ṝݸඪແ᮫తෆ။ඃߟྀɻ • ༗Ұࠣىိແ᮫ɼୠੋఈመ࡞༗᮫త။ඃߟ
ྀɻ ൺํ㘸 conditional conformanceɻ • େ֓။၏౸໌य़ఱ
Conditional Conformance extension Array : Equatable where Element : Equatable
{ } func ==<T : Equatable>(lhs: Array<T>, rhs: Array<T>) -> Bool { ... }
ୈҰ֊ஈ • ሢࡏఔࣜᛰ ABI తᜦఆɻ؆ᄸိ㘸बੋ૬༰ ੑɻ • Ṝݸඪແ᮫తෆ။ඃߟྀɻ • ༗Ұࠣىိແ᮫ɼୠੋఈመ࡞༗᮫త။ඃߟ
ྀɻ ൺํ㘸 conditional conformanceɻ • େ֓။၏౸໌य़ఱ
ఔࣜᛰ૬༰ੑ • ᩋ࠷৽త Compiler Լ૬༰ɻ • ⃧ՃҰݸྨࣅ -std=swift3 ṜҰྨత Compiler
બ ߲ɻ • ࢧԉመᱛੑޭೳతతબ߲ɼ૾ੋ -fcool-new-feature
ఔࣜᛰత䧬ੑ • ආ໔ఔࣜҼҝ API վᏓࣕᆦᎃ • ᩋSwift త API ՄҎ༗ԋԽతػ။
• ൺํ㘸ආ໔ fragile base class ɻ
Fragile Base Class class Foo{ func p(str:String){ print(str) } }
class Bar : Foo{ func log(str:String){ p(str: str) } }
Fragile Base Class class Foo{ func p(str:String){ //print(str) //ෆཁ౸႔စ print
} } class Bar : Foo{ func log(str:String){ p(str: str) } }
Fragile Base Class class Foo{ func p(str:String){ //print(str) //ෆཁ౸႔စ print
} } class Bar : Foo{ func log(str:String){ p(str: str) // } }
ආ໔ Fragile Base Class • ༻ private, internal, public, open,
final ᮫伴ࣈ • ༗ଧࢉඃਓঝతClass ࠽֘ඃঝɻ
ABI मվ • 㗞ੜ bytecode త෦༗ଟࡉઅཁमվɻ • ෆӨڹҰൠUserɻ
վਐ Generic • ࢧԉ Conditional Conformance Recursive protocol constraintsɻ
• Ҏٴଖሏ ABI ༗᮫తमվɻ
Recursive protocol constrains protocol Tree{ associatedtype Child : Tree }
ߋతString • String ඇৗॏཁɻ • ቮៃ༗ଟमվత๏ • ඪੋൺ Perl ߋత
String processing!
Memory Ownership model • อཹARC, ⃧ՃҰݸֹ֎૾Rustత ownership modelɻ • ᩋ
Swift ༗ߋೳⴺ༬ଌతᏈೳɻ • ။େ෯मվABI, Type Systemɻ
ୈೋ֊ஈ • ࣄॱརతؐ༗࣌ؒ၏ଖଞతॏཁޭೳ • ༗ଟೳ၏తɼෆաॱং౸࣌ި࠽။ܾఆɻ
Reflection • ቮៃ༗େ෦త data reflectionɼୠधཁ৽⃧༻త User APIɻ • धཁઃܭ৽త method
reflection runtime API
First Class Concurrency • Actor, async/await, atomic ೭ྨత • 㑌ݸਓཁ
• ೭ޙ။త౼ɼෆաSwift 4 ग़ိલጯ֘၏ෆ ɻ
վਐ Generic • ABI ᔒ᮫త෦ɻ • ᩋ Swift Generic ߋڧେɻ
ᜦఆ .swiftmodule • ࡏṜ೭લཁઌ༗ᜦఆత ABI
Scripting ޭೳ • ਖ਼نදࣔࣜ , ଟߦతString • ෆሜscript తਓཁɼ၏Web
తਓཁ
Property తߦҝ • ᩋProperty ߋ༻ɻൺํ㘸 observer ɼଟॏ accessor
ଖଞҰେଯ • Submodules • implicit promotions between numeric types
• importing C++ APIs • hygenic macro system • guaranteed tail calls • making enums enumerable • typed ‘throws’ • user defined attributes • abstract methods/classes • better SIMD support • ‘dynamic’ for non- at objc • data parallelism support • higher kinded types • ൟෆٴඋࡌ
Syntactic Sugar • ଟ • ࠷༏ઌ
݁ • Swift 4 ။ઌᜦఆ Source & ABI • ။༗৽త
Memory Model • Swift 3 ጯ֘ࠓळఱ။ग़
Q&A