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
880
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
300
Future of Xtext (with Sebastian Zarnekow)
svenefftinge
0
17k
Other Decks in Technology
See All in Technology
Reducing Cross-Zone Egress at Spotify with Custom gRPC Load Balancing Recap
koh_naga
0
210
Kernel MemoryでAzure OpenAI Serviceとお手軽データソース連携
mitsuzono
1
250
検証を通して見えてきたTiDBの性能特性
lycorptech_jp
PRO
6
3.8k
プロンプトエンジニアリングでがんばらない-Agentic Workflow へ-近藤憲児
kenjikondobai
2
710
Meta Quest 3 で動く桜マシマシ WebXR アプリを IBM Cloud Code Engine と Babylon.js で作った話
1ftseabass
PRO
0
120
Azure Container Apps + Bicep 〜 こんな感じで運用しています
kaz29
2
480
APIファーストなプロダクトマネジメントの実践 〜SaaSus Platformでの例〜 / "Practicing API-First Product Management - An Example with SaaSus Platform
oztick139
0
110
LLM開発・活用の舞台裏@2024.04.25
yushin_n
1
300
Google Cloud Next '24でブログを10本書いた方法と勉強会を沸かせた方法
yasumuusan
0
300
AWSに詳しくない人でも始められるコスト最適化ガイド
yuhta28
1
240
アクセシビリティを考慮したUI/CSSフレームワーク・ライブラリ選定
yajihum
2
1k
Tellus の衛星データを見てみよう #mf_fukuoka
kongmingstrap
0
190
Featured
See All Featured
Happy Clients
brianwarren
92
6.4k
The Invisible Side of Design
smashingmag
294
49k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
322
20k
Art, The Web, and Tiny UX
lynnandtonic
289
19k
Six Lessons from altMBA
skipperchong
21
3k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
241
1.2M
4 Signs Your Business is Dying
shpigford
175
21k
How GitHub (no longer) Works
holman
304
140k
A Tale of Four Properties
chriscoyier
151
22k
Fireside Chat
paigeccino
21
2.6k
Bash Introduction
62gerente
604
210k
Typedesign – Prime Four
hannesfritz
36
2.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