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.4k
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
9k
Go - CLI Tools Design
kaneshin
0
6.7k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
92
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
88
Summer Internship 2018 - How to develop a product
kaneshin
0
69
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
Recoilを剥がしている話
kirik
5
6.6k
Webエンジニア主体のモバイルチームの 生産性を高く保つためにやったこと
igreenwood
0
330
【re:Growth 2024】 Aurora DSQL をちゃんと話します!
maroon1st
0
770
複雑な仕様に立ち向かうアーキテクチャ
myohei
0
170
fs2-io を試してたらバグを見つけて直した話
chencmd
0
220
ゆるやかにgolangci-lintのルールを強くする / Kyoto.go #56
utgwkk
1
370
採用事例の少ないSvelteを選んだ理由と それを正解にするためにやっていること
oekazuma
2
1k
Cloudflare MCP ServerでClaude Desktop からWeb APIを構築
kutakutat
1
540
talk-with-local-llm-with-web-streams-api
kbaba1001
0
180
急成長期の品質とスピードを両立するフロントエンド技術基盤
soarteclab
0
920
testcontainers のススメ
sgash708
1
120
Fibonacci Function Gallery - Part 1
philipschwarz
PRO
0
210
Featured
See All Featured
Embracing the Ebb and Flow
colly
84
4.5k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
A better future with KSS
kneath
238
17k
KATA
mclloyd
29
14k
We Have a Design System, Now What?
morganepeng
51
7.3k
Building Better People: How to give real-time feedback that sticks.
wjessup
365
19k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
44
9.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
132
33k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
26
1.5k
A Philosophy of Restraint
colly
203
16k
Statistics for Hackers
jakevdp
796
220k
How to train your dragon (web standard)
notwaldorf
88
5.7k
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