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
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
310
Future of Xtext (with Sebastian Zarnekow)
svenefftinge
0
18k
Other Decks in Technology
See All in Technology
[JSAC 2025 LT] Introduction to MITRE ATT&CK utilization tools by multiple LLM agents and RAG
4su_para
1
120
iPadOS18でフローティングタブバーを解除してみた
sansantech
PRO
1
160
EMConf JP の楽しみ方 / How to enjoy EMConf JP
pauli
2
150
20250116_自部署内でAmazon Nova体験会をやってみた話
riz3f7
1
130
FODにおけるホーム画面編成のレコメンド
watarukudo
PRO
2
380
いま現場PMのあなたが、 経営と向き合うPMになるために 必要なこと、腹をくくること
hiro93n
9
8.3k
AWS Community Builderのススメ - みんなもCommunity Builderに応募しよう! -
smt7174
0
200
生成AI × 旅行 LLMを活用した旅行プラン生成・チャットボット
kominet_ava
0
170
フラット構造をやめた理由と、EM / Tech Leadを作った理由
baroqueworksdev
0
260
re:Invent2024 KeynoteのAmazon Q Developer考察
yusukeshimizu
1
170
データ基盤におけるIaCの重要性とその運用
mtpooh
4
690
「隙間家具OSS」に至る道/Fujiwara Tech Conference 2025
fujiwara3
7
6.7k
Featured
See All Featured
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
280
13k
Why Our Code Smells
bkeepers
PRO
335
57k
It's Worth the Effort
3n
183
28k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
98
18k
Facilitating Awesome Meetings
lara
51
6.2k
Measuring & Analyzing Core Web Vitals
bluesmoon
5
210
YesSQL, Process and Tooling at Scale
rocio
170
14k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
39
1.9k
Statistics for Hackers
jakevdp
797
220k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
7k
Testing 201, or: Great Expectations
jmmastey
41
7.2k
Java REST API Framework Comparison - PWX 2021
mraible
28
8.3k
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