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
DSLの使い所
Search
disc99
March 27, 2017
Technology
98
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DSLの使い所
disc99
March 27, 2017
More Decks by disc99
See All by disc99
マルチプロダクト×マルチテナントを支えるモジュラモノリスを中心としたアソビューのアーキテクチャ
disc99
1
1.4k
アーキテクチャ選択の裏側
disc99
0
130
120リポジトリを1つのMonorepoに統合した理由
disc99
1
1.3k
モノリスとマイクロサービスを経てモジュラモノリスを導入した実践事例
disc99
25
15k
PaaS DX by Cloud Native Buildpacks
disc99
0
290
全てのAPIをProtocol Buffersで管理する / Manage all APIs with Protocol Buffers
disc99
2
5.8k
Serverless Application
disc99
1
3.3k
イベント駆動マイクロサービスアーキテクチャ / Event-Driven Microservices Architecture
disc99
4
3.2k
Event Sourcing 101
disc99
1
230
Other Decks in Technology
See All in Technology
あるけみー式LTスライド作成術
alchemy1115
2
220
Claude Codeを「使うほど育つ」AI秘書にするノウハウ
minorun365
PRO
31
26k
Minecraft JavaのMODをSwiftで作る
1mash0
0
170
作って終わりじゃないサーバーレス 〜9年運用する大規模EC物流API基盤の設計・運用のリアル〜
zozotech
PRO
0
130
SREは、MCPとAutopilotをこう使え!
kazumax55
3
870
aws-iot-platform-architecture-use-cases.pdf
ma2shita
0
260
映像変換サーバーなしで端末内でHLSを生成してライブ配信
hikarusato
0
120
DEFCON_CHV_CTF_Write-up.pdf
bata_24
0
150
空間オーディオで過去の 自分(ゴースト)と競うランニング 〜HealthKitのルートを足音に変える実装〜
nao_randd
0
220
ユーザー価値を届け続けるためにウォンテッドリーが大切にしている文化
kotaminato
0
170
すぐできる衛星通信対応 あとは山奥に行くだけ
tatetate55
0
130
Cloudflare Workers 向けアプリを C# で構築する ~WASM Native AOT への道~
nenonaninu
0
130
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1.6k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
1
550
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
35
2.6k
Utilizing Notion as your number one productivity tool
mfonobong
4
590
Designing for Performance
lara
611
70k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.6k
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
450
Test your architecture with Archunit
thirion
2
2.4k
Facilitating Awesome Meetings
lara
57
7.1k
Transcript
DSLの使い所 #ShinjukuLT @disc99
もくじ • DSLとは • DSLの種類類 • DSLの利利⽤用例例 • まとめ
DSLとは • ドメイン特化⾔言語(Domain Specific Language) • <=> 汎⽤用⾔言語(JavaやRubyなど) • 特定の領域(ドメイン)の問題を解決
• ミニ⾔言語
なぜDSL? • ドメイン特化⾔言語 > コードは当該分野の専⾨門 家にとって読みやすく理理解 しやすくなります
DSLの種類類 • 内部DSL • 汎⽤用のプログラミング⾔言語の機能を利利⽤用 • 外部DSL • 汎⽤用のプログラミング⾔言語とは別の構⽂文
内部DSL • ホスト⾔言語(Java、Rubyなどの汎⽤用⾔言語) • ⾃自由度が⾼高い⾔言語が便便利利(シンタックスシュ ガー、フォーマット、AST変換、マクロなど) • ホスト⾔言語の機能を呼び出せるものもある • ホスト⾔言語の構⽂文の制約あり
内部DSLの利利⽤用例例 • Gradle: ビルドに特化(Groovy) • Vagrant: 仮想開発環境構築に特化(Ruby) • Gatling: 負荷テストに特化(Scala)
• Apache Camel: 様々な処理理を連結に特化 (Java)
外部DSL • ホスト⾔言語の制約がほとんど無い • 問題領域に対して最適な表現を選択できる • 構⽂文解析機能が必要
外部DSLの利利⽤用例例 • make: ビルド⾃自動化に特化 • 2Way-SQL: アプリ、ツール両⽅方からのSQLの 実⾏行行に特化 • SQLそのものやCSSなど分類類される場合も
My DSL • Hogan • https://github.com/disc99/hogan • DB操作を直感的に⾏行行うためのライブラリ • DB操作に特化
• Groovyの演算⼦子オーバーロードとAST変換を利利⽤用
Hoganの利利⽤用例例 • SQLテーブルっぽく構 造を定義 => INSERT実⾏行行
コントリビュート⼤大歓迎!!
まとめ • DSLは問題領域(ドメイン)に特化した⾔言語 • DSLには内部DSLと外部DSLが存在する • どちらを使うかはドメインをどのように表現し たいか次第 • DSLには⼀一定の学習コスト、メンテコストが発
⽣生するので適切な使い所を考える
参考 • プログラマが知るべき97のこと:ドメイン特化⾔言語 • http:// xn--97-273ae6a4irb6e2hsoiozc2g4b8082p.co m/ %E3%82%A8%E3%83%83%E3%82%BB%E3% 82%A4/%E3%83%89%E3%83%A1%E3%82% A4%E3%83%B3%E7%89%B9%E5%8C%96%E
8%A8%80%E8%AA%9E