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
企業の生成AIガバナンスにおけるエージェントとセキュリティ
lycorptech_jp
PRO
3
200
Wantedlyの開発組織における生成AIの浸透プロジェクトについて
kotominaga
2
120
Autonomous Database - Dedicated 技術詳細 / adb-d_technical_detail_jp
oracle4engineer
PRO
4
10k
Snowflake Intelligence × Document AIで“使いにくいデータ”を“使えるデータ”に
kevinrobot34
1
120
メルカリIBISの紹介
0gm
0
710
開発者を支える Internal Developer Portal のイマとコレカラ / To-day and To-morrow of Internal Developer Portals: Supporting Developers
aoto
PRO
1
480
DroidKaigi 2025 Androidエンジニアとしてのキャリア
mhidaka
2
390
会社紹介資料 / Sansan Company Profile
sansan33
PRO
7
380k
機械学習を扱うプラットフォーム開発と運用事例
lycorptech_jp
PRO
0
680
Rustから学ぶ 非同期処理の仕組み
skanehira
1
150
現場で効くClaude Code ─ 最新動向と企業導入
takaakikakei
1
260
Webアプリケーションにオブザーバビリティを実装するRust入門ガイド
nwiizo
7
890
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
実際に使うSQLの書き方 徹底解説 / pgcon21j-tutorial
soudai
PRO
188
55k
Context Engineering - Making Every Token Count
addyosmani
3
63
Optimizing for Happiness
mojombo
379
70k
Gamification - CAS2011
davidbonilla
81
5.4k
Visualization
eitanlees
148
16k
Making Projects Easy
brettharned
117
6.4k
Building Flexible Design Systems
yeseniaperezcruz
329
39k
The Illustrated Children's Guide to Kubernetes
chrisshort
48
50k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
252
21k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
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