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
99
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.5k
アーキテクチャ選択の裏側
disc99
0
130
120リポジトリを1つのMonorepoに統合した理由
disc99
1
1.4k
モノリスとマイクロサービスを経てモジュラモノリスを導入した実践事例
disc99
25
15k
PaaS DX by Cloud Native Buildpacks
disc99
0
290
全てのAPIをProtocol Buffersで管理する / Manage all APIs with Protocol Buffers
disc99
2
5.9k
Serverless Application
disc99
1
3.3k
イベント駆動マイクロサービスアーキテクチャ / Event-Driven Microservices Architecture
disc99
4
3.3k
Event Sourcing 101
disc99
1
240
Other Decks in Technology
See All in Technology
QA4AI 2026-Oct 生成AI時代の品質保証
tokuty
1
930
その Valkey 使いこなしていますか?
onk
PRO
5
1.7k
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
130
What Is JetBrains Air
x5gtrn
PRO
0
130
フロントエンドカンファレンス関西2026 - 速すぎるUIに、待ち時間を
teamlab
PRO
0
220
Refining Active Record
shugo
0
180
夫婦で子育てするための育児標準化
codmoninc
PRO
0
520
PagerDuty Tech Hub-鳴らすけれど、人は動かない
ezaki
0
190
会社紹介資料 / Sansan Company Profile
sansan33
PRO
31
430k
Persisting Massive Data with Rails ~Designing for 60 billion rows, and fighting the bottlenecks~ Railsで挑む大量データ永続化 〜600億件を永続化するための設計とボトルネックとの戦い〜
occhi
0
770
SAENM ~Jupyterで残すPoCの試行錯誤、未来の自分と仲間を助ける記録!~
terapyon
0
170
LLM Content Moderationを支える評価・改善ループの実践
suikabar
1
250
Featured
See All Featured
Applied NLP in the Age of Generative AI
inesmontani
PRO
4
2.5k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
25
2.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
Mobile First: as difficult as doing things right
swwweet
225
10k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
What does AI have to do with Human Rights?
axbom
PRO
1
2.5k
YesSQL, Process and Tooling at Scale
rocio
174
15k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
230
23k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
710
The Cult of Friendly URLs
andyhume
79
7k
WENDY [Excerpt]
tessaabrams
14
40k
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