SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
SwiftCoreと
Foundationを読んで
みた
Mercari Inc.
@kitasuke
Swift open sourced!
事前準備
Swift のソースファイルを Xcode で開ける
ようにする
熊谷さんの記事が分かり易い
準備段階で出来なかったこと
.gybファイルが開かない?
Swift Package Managerのプロジェクトが
生成されない?
概要
主に使用されている言語
→ Swift
→ C++
→ C
Swiftで書かれている主な箇所
→ SwiftCore
→ Foundation
→ TestFoundation
→ Swift Package Manager
未実装・修正すべき箇所
→ fatalError("not implemented")
→ FIXME
→ NSUnimplemented()
Contributor出来そうな箇所
→ バグ修正
→ テスト修正
→ 未実装機能の追加
参考になったもの
(SwiftCore)
swift/docsにあるドキュメント
→ Array.rst
→ Generics.rst
→ Literals.rst
→ Pattern Matching.rst
→ Testing.rst
LangRefNew.rst
→ Whitespace and Comments
→ Reserved Punctuation Tokens
→ Reserved Keywords
→ Contextual Keywords
→ Integer Literals
→ Operator Tokens
良く見たもの
→ nonmutating set
→ public prefix func
→ infix operator
Attr.def
→ TYPEATTR(objcblock)
→ SIMPLEDECLATTR(noreturn, NoReturn,
OnFunc, 7)
→ DECL_ATTR(autoclosure, AutoClosure,
OnParam, 28)
良く見たもの
→ @_transparent
→ @silgenname
→ @inline(never)
→ @effects(readonly)
Swift Intermediate Language
(SIL.rst)
→ Address Types
→ Local Storage Types
→ Box Types
→ Function Types
→ Properties of Types
Builtin.def
→ BUILTINSILOPERATION(Retain, "retain",
Special)
→ BUILTINMISCOPERATION(Sizeof, "sizeof",
"n", Special)
→
BUILTINSILOPERATION(CastToNativeObj
ect, "castToNativeObject", Special)
良く見たもの
→ Builtin.addressof($0)
→ Builtin.NativeObject
→ Builtin.castFromNativeObject($0)
→ Builtin.bridgeToRawPointer($0)
参考になったもの
(Foundation)
TestFoundation
→ TestNSArray.swift
→ TestNSFileManager.swift
→ TestNSURL.swift
→ TestNSNull.swift
まとめ
→ Foundationの方が読みやすい
→ Swiftを勉強するためにC++を勉強する
→ 読んでるだけで楽しい!

Weitere ähnliche Inhalte

Andere mochten auch (13)

WKInterfaceMap on Apple Watch
WKInterfaceMap on Apple WatchWKInterfaceMap on Apple Watch
WKInterfaceMap on Apple Watch
 
Useful and Practical Functionalities in Realm
Useful and Practical Functionalities in RealmUseful and Practical Functionalities in Realm
Useful and Practical Functionalities in Realm
 
Uiテスト@yidev
Uiテスト@yidevUiテスト@yidev
Uiテスト@yidev
 
WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由WWDCのチケット外れてもSFに行った方が良い理由
WWDCのチケット外れてもSFに行った方が良い理由
 
Protocol in Swift
Protocol in SwiftProtocol in Swift
Protocol in Swift
 
Introducing Cardio
Introducing CardioIntroducing Cardio
Introducing Cardio
 
Search APIs in Spotlight and Safari
Search APIs in Spotlight and SafariSearch APIs in Spotlight and Safari
Search APIs in Spotlight and Safari
 
Advanced realm in swift
Advanced realm in swiftAdvanced realm in swift
Advanced realm in swift
 
iOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotipsiOSにおけるUIテスト@potetotips
iOSにおけるUIテスト@potetotips
 
User Scenario based UI testing with KIF
User Scenario based UI testing with KIFUser Scenario based UI testing with KIF
User Scenario based UI testing with KIF
 
How to make workout app for watch os 2
How to make workout app for watch os 2How to make workout app for watch os 2
How to make workout app for watch os 2
 
Command Line Tool in swift
Command Line Tool in swiftCommand Line Tool in swift
Command Line Tool in swift
 
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSConType-safe Web APIs with Protocol Buffers in Swift at iOSCon
Type-safe Web APIs with Protocol Buffers in Swift at iOSCon
 

Ähnlich wie SwiftCoreとFoundationを読んでみた

CakePHP - The point of upgrade
CakePHP - The point of upgradeCakePHP - The point of upgrade
CakePHP - The point of upgrade
Yasuo Harada
 
CodeIgniter東京勉強会 2011.05.14
CodeIgniter東京勉強会 2011.05.14CodeIgniter東京勉強会 2011.05.14
CodeIgniter東京勉強会 2011.05.14
Takako Miyagawa
 
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
Kentarou Takeda
 
OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門
irix_jp
 
IDEを目指す開発者コンソール
IDEを目指す開発者コンソールIDEを目指す開発者コンソール
IDEを目指す開発者コンソール
minoaw
 
Tizen 2.0 alpha でサポートされなかった native api
Tizen 2.0 alpha でサポートされなかった native apiTizen 2.0 alpha でサポートされなかった native api
Tizen 2.0 alpha でサポートされなかった native api
Naruto TAKAHASHI
 

Ähnlich wie SwiftCoreとFoundationを読んでみた (20)

Code igniterでテスト駆動開発 資料作成中
Code igniterでテスト駆動開発 資料作成中Code igniterでテスト駆動開発 資料作成中
Code igniterでテスト駆動開発 資料作成中
 
Java/Androidセキュアコーディング
Java/AndroidセキュアコーディングJava/Androidセキュアコーディング
Java/Androidセキュアコーディング
 
Xcode4 project template (slide)
Xcode4 project template (slide)Xcode4 project template (slide)
Xcode4 project template (slide)
 
CakePHP - The point of upgrade
CakePHP - The point of upgradeCakePHP - The point of upgrade
CakePHP - The point of upgrade
 
20170527 inside .NET Core on Linux
20170527 inside .NET Core on Linux20170527 inside .NET Core on Linux
20170527 inside .NET Core on Linux
 
CodeIgniter東京勉強会 2011.05.14
CodeIgniter東京勉強会 2011.05.14CodeIgniter東京勉強会 2011.05.14
CodeIgniter東京勉強会 2011.05.14
 
Swift
SwiftSwift
Swift
 
2022年ASP.NETCore2.2~6.0の旅.pptx
2022年ASP.NETCore2.2~6.0の旅.pptx2022年ASP.NETCore2.2~6.0の旅.pptx
2022年ASP.NETCore2.2~6.0の旅.pptx
 
Swift を振り返ってみよう #cswift
Swift を振り返ってみよう #cswiftSwift を振り返ってみよう #cswift
Swift を振り返ってみよう #cswift
 
sveltekit-ja.pdf
sveltekit-ja.pdfsveltekit-ja.pdf
sveltekit-ja.pdf
 
既存プロジェクトにSwiftLintを導入した話
既存プロジェクトにSwiftLintを導入した話既存プロジェクトにSwiftLintを導入した話
既存プロジェクトにSwiftLintを導入した話
 
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
バリデーション駆動開発(仮称)で プロジェクトメンバー全員を幸せにした話
 
最近作ったもの
最近作ったもの最近作ったもの
最近作ったもの
 
OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門OSC2011Tokyo/Fall OpenStack Swift入門
OSC2011Tokyo/Fall OpenStack Swift入門
 
nomlab_okayamaruby_slide
nomlab_okayamaruby_slidenomlab_okayamaruby_slide
nomlab_okayamaruby_slide
 
20140822 Swift 勉強会 vol.3 - はぢめての Swift
20140822 Swift 勉強会 vol.3 - はぢめての Swift20140822 Swift 勉強会 vol.3 - はぢめての Swift
20140822 Swift 勉強会 vol.3 - はぢめての Swift
 
IDEを目指す開発者コンソール
IDEを目指す開発者コンソールIDEを目指す開発者コンソール
IDEを目指す開発者コンソール
 
Bundler kanazawa.rb meetup #2 2012/09/19
Bundler kanazawa.rb meetup #2 2012/09/19Bundler kanazawa.rb meetup #2 2012/09/19
Bundler kanazawa.rb meetup #2 2012/09/19
 
Recording and Replay on HoloLens [dotNET 600]
Recording and Replay on HoloLens [dotNET 600]Recording and Replay on HoloLens [dotNET 600]
Recording and Replay on HoloLens [dotNET 600]
 
Tizen 2.0 alpha でサポートされなかった native api
Tizen 2.0 alpha でサポートされなかった native apiTizen 2.0 alpha でサポートされなかった native api
Tizen 2.0 alpha でサポートされなかった native api
 

Mehr von Yusuke Kita

Integrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipelineIntegrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipeline
Yusuke Kita
 

Mehr von Yusuke Kita (18)

Integrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipelineIntegrating libSyntax into the compiler pipeline
Integrating libSyntax into the compiler pipeline
 
Making your own tool using SwiftSyntax
Making your own tool using SwiftSyntaxMaking your own tool using SwiftSyntax
Making your own tool using SwiftSyntax
 
[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline[Deprecated] Integrating libSyntax into the compiler pipeline
[Deprecated] Integrating libSyntax into the compiler pipeline
 
Creating your own Bitrise step
Creating your own Bitrise stepCreating your own Bitrise step
Creating your own Bitrise step
 
Introducing swift-format
Introducing swift-formatIntroducing swift-format
Introducing swift-format
 
Unidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUIUnidirectional Data Flow Through SwiftUI
Unidirectional Data Flow Through SwiftUI
 
Open Source Swift Workshop
Open Source Swift WorkshopOpen Source Swift Workshop
Open Source Swift Workshop
 
Contributing to Swift Compiler
Contributing to Swift CompilerContributing to Swift Compiler
Contributing to Swift Compiler
 
Writing a compiler in go
Writing a compiler in goWriting a compiler in go
Writing a compiler in go
 
Writing an interpreter in swift
Writing an interpreter in swiftWriting an interpreter in swift
Writing an interpreter in swift
 
SIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStackSIL Optimizations - AllocBoxToStack
SIL Optimizations - AllocBoxToStack
 
SIL for First Time Learners
SIL for First Time LearnersSIL for First Time Learners
SIL for First Time Learners
 
var, let in SIL
var, let in SILvar, let in SIL
var, let in SIL
 
SIL for First Time Leaners LT
SIL for First Time Leaners LTSIL for First Time Leaners LT
SIL for First Time Leaners LT
 
How to try! Swift
How to try! SwiftHow to try! Swift
How to try! Swift
 
SIL for the first time
SIL for the first timeSIL for the first time
SIL for the first time
 
Introducing protobuf in Swift
Introducing protobuf in SwiftIntroducing protobuf in Swift
Introducing protobuf in Swift
 
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConfType-safe Web APIs with Protocol Buffers in Swift at AltConf
Type-safe Web APIs with Protocol Buffers in Swift at AltConf
 

SwiftCoreとFoundationを読んでみた