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
4.7k
1
Share
Generative Programming in Swift
JSON Schema + APIKit Generator
https://github.com/kaneshin/genkit
Shintaro Kaneko
August 20, 2016
More Decks by Shintaro Kaneko
See All by Shintaro Kaneko
How to keep growing SRE team at Eureka
kaneshin
3
9.7k
Go - CLI Tools Design
kaneshin
0
7k
Summer Internship 2018 - The principle of the eureka summer internship 2018
kaneshin
2
130
Summer Internship 2018 - The eureka summer internship 2018
kaneshin
0
140
Summer Internship 2018 - How to develop a product
kaneshin
0
120
How to write Go code
kaneshin
8
8.5k
Go Package Guidelines
kaneshin
1
1.2k
net/http package ~GoConference 2017 Spring~
kaneshin
1
3k
Essentials of Golang
kaneshin
5
14k
Other Decks in Programming
See All in Programming
サーバーレスで作る、動画データ管理基盤
oyasumipants
0
320
AIエージェントの隔離技術の徹底比較
kawayu
0
450
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
990
Swiftのレキシカルスコープ管理
kntkymt
0
200
Transactional Change Stream Processing With Debezium and Apache Flink
gunnarmorling
1
140
PHPで使える日時の表現と、その知り方 #frontend_phpcon_do
o0h
PRO
0
140
CLIであることを活かしたGitHub Copilot CLI活用術 / GitHub Copilot CLI Pro Tips & Tricks
nao_mk2
1
1.2k
誰も頼んでない機能を出荷した話
zekutax
0
150
The Arts and Crafts of Work in the AI Era — Toward Mastery in Software Development
kuranuki
1
680
AI時代のUIはどこへ行く?その2!
yusukebe
15
4.6k
These Five Tricks Can Make Your Apps Greener, Cheaper, & Nicer
hollycummins
0
250
TypeScriptだけでAIエージェントを作る フロント・エージェント・インフラのフルスタック実践
har1101
6
1.2k
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Build your cross-platform service in a week with App Engine
jlugia
234
18k
My Coaching Mixtape
mlcsv
0
140
Claude Code のすすめ
schroneko
67
220k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
670
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
What's in a price? How to price your products and services
michaelherold
247
13k
Statistics for Hackers
jakevdp
799
230k
Abbi's Birthday
coloredviolet
2
7.8k
Embracing the Ebb and Flow
colly
88
5.1k
How to audit for AI Accessibility on your Front & Back End
davetheseo
0
390
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.8k
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