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
DSL Design - Best Practices (XtextCON 2015)
Search
Sven Efftinge
May 20, 2015
Technology
0
1.1k
DSL Design - Best Practices (XtextCON 2015)
Sven Efftinge
May 20, 2015
Tweet
Share
More Decks by Sven Efftinge
See All by Sven Efftinge
Life of a Resource (XtextCON 2015)
svenefftinge
0
320
Future of Xtext (with Sebastian Zarnekow)
svenefftinge
0
18k
Other Decks in Technology
See All in Technology
ざっくり学ぶ 『エンジニアリングリーダー 技術組織を育てるリーダーシップと セルフマネジメント』 / 50 minute Engineering Leader
iwashi86
9
4.5k
日本のソブリンAIを支えるエヌビディアの生成AIエコシステム
acceleratedmu3n
0
130
AI-ready"のための"データ基盤 〜 LLMOpsで事業貢献するための基盤づくり
ismk
0
120
NOT A HOTEL SOFTWARE DECK (2025/11/06)
notahotel
0
3.1k
어떤 개발자가 되고 싶은가?
arawn
1
440
ソフトウェア品質を支える テストとレビュー再考 / 吉澤 智美さん
findy_eventslides
0
110
プロダクト開発と社内データ活用での、BI×AIの現在地 / Data_Findy
sansan_randd
1
820
短期間でRAGシステムを実現 お客様と歩んだ生成AI内製化への道のり
taka0709
1
190
AI時代の発信活動 ~技術者として認知してもらうための発信法~ / 20251028 Masaki Okuda
shift_evolve
PRO
1
140
20251106 Offers DeepDive 知識を民主化!あらゆる業務のスピードと品質を 改善するためのドキュメント自動更新・活用術
masashiyokota
1
210
251029 JAWS-UG AI/ML 退屈なことはQDevにやらせよう
otakensh
0
190
AIの個性を理解し、指揮する
shoota
3
630
Featured
See All Featured
Intergalactic Javascript Robots from Outer Space
tanoku
273
27k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
A designer walks into a library…
pauljervisheath
209
24k
Unsuck your backbone
ammeep
671
58k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
9
1k
[RailsConf 2023] Rails as a piece of cake
palkan
57
6k
How to Ace a Technical Interview
jacobian
280
24k
Context Engineering - Making Every Token Count
addyosmani
8
330
Become a Pro
speakerdeck
PRO
29
5.6k
Building Adaptive Systems
keathley
44
2.8k
Keith and Marios Guide to Fast Websites
keithpitt
412
23k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
36
6.1k
Transcript
DSL DESIGN Sven Efftinge
Why an External DSL • Write the thing you care
in the way you want • Have compile time feedback, that understand your domain • Be cross platform / platform independent
DSL Design != GPL Design
A Good DSL makes editing simpler makes reading simpler improves
stakeholder communication uses a familiar syntax nicely integrates into workflow tools and execution are fast is highly maintainable
DSL A Powerful Programming Interface User Interface
Who does What Requirements Engineering
Use Existing Domain Terminology
Use Familiar SYNTAX
When To Sugar Be explicit and regular unless the concept
is used often and well known
Never Change
class { visibility=public name="HelloWorld" members = [ method { visibility=public
static=true returnType=void name="main" parameters = [ parameter { type = String varArgs = true name = args } ] ... } ] } public class HelloWorld { public static void main(String... args) { System.out.println("Hello World"); } } Generic vs. Specific
Business Readable DSLs
Use Structure, use Whitespace
Be Regular
Keywords First reduces look ahead for the parser &
the reader visual anchor
Good Defaults
Multiple Files FTW a package or namespace is a logical
container but not necessarily a physical! improves collaboration
Names! Simple name clashes are rare We think in names
No more UUIDs!
Loose Grammar
Strict Validation
you ain’t gonna need it
Don’t Reinvent Expressions
Invasiveness • The outside view must only change when
the file changes physically • Bad Example: Xtend return types
Dynamic Scoping Never!
Preprocessors Nooo!
N-to-1 Code Generation source source generated No more incremental builds!
OutOfMemoryException!
Questions