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
Generative Programming in Swift
Search
Shintaro Kaneko
August 20, 2016
Programming
1
4.3k
Generative Programming in Swift
JSON Schema + APIKit Generator
https://github.com/kaneshin/genkit
Shintaro Kaneko
August 20, 2016
Tweet
Share
More Decks by Shintaro Kaneko
See All by Shintaro Kaneko
How to keep growing SRE team at Eureka
kaneshin
3
8.9k
Go - CLI Tools Design
kaneshin
0
6.7k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
90
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
87
Summer Internship 2018 - How to develop a product
kaneshin
0
67
How to write Go code
kaneshin
8
8.1k
Go Package Guidelines
kaneshin
1
1.1k
net/http package ~GoConference 2017 Spring~
kaneshin
1
2.7k
Essentials of Golang
kaneshin
5
13k
Other Decks in Programming
See All in Programming
Realtime API 入門
riofujimon
0
150
2024/11/8 関西Kaggler会 2024 #3 / Kaggle Kernel で Gemma 2 × vLLM を動かす。
kohecchi
5
950
Tauriでネイティブアプリを作りたい
tsucchinoko
0
370
3 Effective Rules for Using Signals in Angular
manfredsteyer
PRO
1
100
Creating a Free Video Ad Network on the Edge
mizoguchicoji
0
120
Quine, Polyglot, 良いコード
qnighy
4
650
Better Code Design in PHP
afilina
PRO
0
130
CSC509 Lecture 13
javiergs
PRO
0
110
Less waste, more joy, and a lot more green: How Quarkus makes Java better
hollycummins
0
100
エンジニアとして関わる要件と仕様(公開用)
murabayashi
0
300
Outline View in SwiftUI
1024jp
1
340
Functional Event Sourcing using Sekiban
tomohisa
0
100
Featured
See All Featured
Into the Great Unknown - MozCon
thekraken
32
1.5k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
131
33k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
33
1.9k
Optimising Largest Contentful Paint
csswizardry
33
2.9k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
191
16k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
BBQ
matthewcrist
85
9.3k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
42
9.2k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.4k
[RailsConf 2023] Rails as a piece of cake
palkan
52
4.9k
Transcript
Generative Programming in Swift Presented by @kaneshin 08/20/2016 iOSDC
@kaneshin (Shintaro Kaneko) - Principal Engineer / Manager - Gopher,
Vimmer, Photographer, Mathematician
None
Unleashing the real power of Core Data with the elegance
and safety of Swift
ੜతϓϩάϥϛϯά Generative Programming
࣮ફ͍ͯ͠Δਓ
Generative Programming - Generics struct Something<T> { let with: T
}
Generative Programming - Generics struct Something<T> { let with: T
}
࣮ફ͍ͯ͠Δਓ
ੜతϓϩάϥϛϯά ͱʁ
ੜతϓϩάϥϛϯά: Generative programming δΣωϦοΫͳΫϥεɺϓϩτλΠϓϕʔεɺςϯϓϨʔτɺΞε ϖΫτɺίʔυੜͳͲͷٕ๏Λͬͯιʔείʔυ࡞ΛࣗಈԽ ͠ɺϓϩάϥϚͷੜ࢈ੑΛ্ͤ͞ΔϓϩάϥϛϯάͷελΠϧͰ ͋Δɻ ιϑτΣΞίϯϙʔωϯτͳͲͷίʔυ࠶ར༻ͷٕ๏ͱ࿈ܞ͠ ͯ༻͞ΕΔɻ
ੜతϓϩάϥϛϯά: Generative programming δΣωϦοΫͳΫϥεɺϓϩτλΠϓϕʔεɺςϯϓϨʔτɺΞε ϖΫτɺίʔυੜͳͲͷٕ๏Λͬͯιʔείʔυ࡞ΛࣗಈԽ ͠ɺϓϩάϥϚͷੜ࢈ੑΛ্ͤ͞ΔϓϩάϥϛϯάͷελΠϧͰ ͋Δɻ ιϑτΣΞίϯϙʔωϯτͳͲͷίʔυ࠶ར༻ͷٕ๏ͱ࿈ܞ͠ ͯ༻͞ΕΔɻ δΣωϦΫεϓϩάϥϛϯά
ੜతϓϩάϥϛϯάͷҰछ
Generics Programming
"Dynamic, highly parameterized software is harder to understand and build
than more static software." (Gang of Four 1995:21)
Generics are a trade off between programmer time, compilation time,
and execution time. See https://github.com/golang/proposal/blob/master/design/15292-generics.md
ੜతϓϩάϥϛϯά: Generative programming δΣωϦοΫͳΫϥεɺϓϩτλΠϓϕʔεɺςϯϓϨʔτɺΞε ϖΫτɺίʔυੜͳͲͷٕ๏Λͬͯιʔείʔυ࡞ΛࣗಈԽ ͠ɺϓϩάϥϚͷੜ࢈ੑΛ্ͤ͞ΔϓϩάϥϛϯάͷελΠϧͰ ͋Δɻ ιϑτΣΞίϯϙʔωϯτͳͲͷίʔυ࠶ར༻ͷٕ๏ͱ࿈ܞ͠ ͯ༻͞ΕΔɻ
Code Generation
JSON Hyper Schema + HTTP Request
JSON Hyper Schema Swagger prmd
HTTP Request Alamofire APIKit
Code Generation • Demo (If enough time to introduce) •
https://github.com/kaneshin/genkit (golang, ver. 0.0.1) • JSON Hyper Schema - prmd • HTTP Request - APIKit
Thank you Credit: NASA Earth Observatory/NOAA NGDC