$30 off During Our Annual Pro Sale. View Details »
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
19k
Other Decks in Technology
See All in Technology
AI時代の開発フローとともに気を付けたいこと
kkamegawa
0
720
タグ付きユニオン型を便利に使うテクニックとその注意点
uhyo
2
700
グレートファイアウォールを自宅に建てよう
ctes091x
0
120
私も懇親会は苦手でした ~苦手だからこそ懇親会を楽しむ方法~ / 20251127 Masaki Okuda
shift_evolve
PRO
4
570
プロダクトマネージャーが押さえておくべき、ソフトウェア資産とAIエージェント投資効果 / pmconf2025
i35_267
2
430
AI (LLM) を活用する上で必須級のMCPをAmazon Q Developerで学ぼう / 20251127 Ikuma Yamashita
shift_evolve
PRO
2
110
AI時代におけるアジャイル開発について
polyscape_inc
0
110
プロダクトマネジメントの分業が生む「デリバリーの渋滞」を解消するTPMの越境
recruitengineers
PRO
3
530
HIG学習用スライド
yuukiw00w
0
110
MCP・A2A概要 〜Google Cloudで構築するなら〜
shukob
0
170
その設計、 本当に価値を生んでますか?
shimomura
3
200
ML PM Talk #1 - ML PMの分類に関する考察
lycorptech_jp
PRO
1
600
Featured
See All Featured
Statistics for Hackers
jakevdp
799
230k
Music & Morning Musume
bryan
46
7k
How To Stay Up To Date on Web Technology
chriscoyier
791
250k
Agile that works and the tools we love
rasmusluckow
331
21k
Automating Front-end Workflow
addyosmani
1371
200k
Thoughts on Productivity
jonyablonski
73
5k
Become a Pro
speakerdeck
PRO
30
5.7k
Navigating Team Friction
lara
191
16k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
13k
Making Projects Easy
brettharned
120
6.5k
The Language of Interfaces
destraynor
162
25k
[RailsConf 2023] Rails as a piece of cake
palkan
58
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