Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
メタプログラミング向けのテンプレートエンジン gysb を作った
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
omochimetaru
November 21, 2017
Programming
640
3
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
メタプログラミング向けのテンプレートエンジン gysb を作った
2017/11/21 関西モバイルアプリ研究会 in 関東
https://kanmoba.connpass.com/event/70685/
omochimetaru
November 21, 2017
More Decks by omochimetaru
See All by omochimetaru
Swift Concurrency 年表クイズ
omochi
3
330
型推論のちょっと深い話
omochi
1
550
Swiftの型推論を学ぼう | Let's Learn About Type Inference in Swift
omochi
4
11k
[スクリプト] Swiftの型推論を学ぼう
omochi
2
560
Swift6のprotocol
omochi
6
1.4k
SwiftSyntaxをうまく使おう
omochi
2
430
今から使えるSwiftとC++の新しいinterop手法
omochi
0
530
CSFixとラベルマッチ
omochi
0
480
Swiftのmodifyアクセサとコルーチン
omochi
0
940
Other Decks in Programming
See All in Programming
Vibes Containers 〜AIで変わるコンテナ設計と運用〜
tkikuc
3
550
LL言語やWebフレームワークのPostgreSQL対応 〜DBの機能がユーザーに届くまで〜
kentaroutakeda
1
150
Omarchy Tokyo やると聞いて UMPC 買ってセットアップしてきた
mtsmfm
0
140
GraphRAGのKnowledge Graphを 直接!見る/View-GraphRAG's-KnowledgeGraph-directly!
tyumugi1113
1
310
WebRTC映像をAirPlayに対応させる挑戦.pdf
monolithic_adam
0
230
cdk deploy JawsSonic #MARATHONしながらAWSリソースをデプロイしてみよう
akihisaikeda
2
130
FreeBSDでZabbixを動かす.pdf
kenkino
0
270
From 6 People Classroom Meetup to 100 People Regional Conference / FOSS4G Hiroshima 2026
furukawayasuto
0
200
AI に Inclusive UI を書かせよう — Design Rules Skill で Compose UI を作り直す
theoriatec2024
1
490
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
620
ゲームコントローラやキーボードのファームウェアをSwiftで書く
kishikawakatsumi
1
240
巨大モノリシックアプリ モダン化大作戦
ktcryomm
0
1k
Featured
See All Featured
Believing is Seeing
oripsolob
1
220
Technical Leadership for Architectural Decision Making
baasie
3
570
The Curse of the Amulet
leimatthew05
3
14k
The browser strikes back
jonoalderson
0
1.7k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
350
Tell your own story through comics
letsgokoyo
1
1.1k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Designing Experiences People Love
moore
143
24k
Marketing Yourself as an Engineer | Alaka | Gurzu
gurzu
0
300
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
The Cult of Friendly URLs
andyhume
79
7k
Product Roadmaps are Hard
iamctodd
55
13k
Transcript
ϝλϓϩάϥϛϯά͚ ͷςϯϓϨʔτΤϯδϯ gysb Λ࡞ͬͨ omochimetaru @
Array ͱ ؒͨͪ Array - startIndex, endIndex, subscript, _ArrayBuffer ArraySlice
- startIndex, endIndex, subscript, _SliceBuffer ContiguousArray - startIndex, endIndex, subscript, _ContiguousArrayBuffer
gyb Generate Your Boilerplate
gyb Generate Your Boilerplate ࣮ߦ: %{ <python code> }% ࣮ߦ:
% <python code> (ߦ) ࣜల։: ${ <python code> }
Arrays.swift.gyb apple/swift @ github
%{ arrayTypes = [ ('ContiguousArray', 'a `ContiguousArray` instance'), ('ArraySlice', 'an
`ArraySlice` instance'), ('Array', 'an array'), ] }% % for (Self, a_Self) in arrayTypes: public struct ${Self}<Element> { %if Self == 'Array': internal typealias _Buffer = _ArrayBuffer<Element> %elif Self == 'ArraySlice': internal typealias _Buffer = _SliceBuffer<Element> %else: internal typealias _Buffer = _${Self.strip('_')}Buffer<Element> %end internal var _buffer: _Buffer } %end
public struct ContiguousArray<Element> { internal typealias _Buffer = _ContiguousBuffer<Element> internal
var _buffer: _Buffer } public struct ArraySlice<Element> { internal typealias _Buffer = _SliceBuffer<Element> internal var _buffer: _Buffer } public struct Array<Element> { internal typealias _Buffer = _ArrayBuffer<Element> internal var _buffer: _Buffer }
gyb ͷྑ͘ͳ͍ͱ͜Ζ
gyb ͷྑ͘ͳ͍ͱ͜Ζ python Λॻ͘ͱ͜Ζ
gysb Generate Your Swifty Boilerplate
gysb Generate Your Swifty Boilerplate https://github.com/omochi/gysb ࣮ߦ: %{ <swift code>
}% ࣮ߦ: % <swift code> (ߦ) ࣜల։: ${ <swift code> }
Demo ࣮ࡍͷσϞͷͱ͖ɺ ҎԼͷιʔεΛࡐʹɺ --source-dirs, --parse, --compile Ϟʔυͷಈ࡞Λհ͠ ͨɻ https://github.com/omochi/ReactiveEmitter/blob/master/ Sources/ReactiveEmitter/Operator/Combine.swift.gysb
gysb ͷ։ൃ gysb ͷಈ࡞ݪཧͦΕࣗମϝλϓϩάϥϛϯά͔ͩΒ Swift ͷϝλϓϩάϥϛϯά͢ΔͨΊʹ Swift ͷϝλϓϩάϥϛϯάΛߦ͏ Swift ϓϩάϥϜΛ࡞ͬͨ
! (͋ͱ Kotlin C++ ੜͰ͖ΔΑ)
(એ) Discord Offline Discord αʔό ios-developers-japan ΛϦΞϧͰ 12/4 ϝϧΧϦ ύωϧσΟεΧογϣϯܗࣜ
https://connpass.com/event/71774/
Sourceryͱͷҧ͍ Sourcery ܕใऔಘ + ςϯϓϨʔτ(ෳݴޠ) gysb ςϯϓϨʔτ Sourcery
ͷ swift ςϯϓϨʔτϥΠϒϥϦඇରԠ gysb gysb.json Ͱ SwiftPM ʹରԠ