Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DSL Design - Best Practices (XtextCON 2015)
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Sven Efftinge
May 20, 2015
Technology
1.1k
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DSL Design - Best Practices (XtextCON 2015)
Sven Efftinge
May 20, 2015
Transcript
27 slides
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
More Decks by Sven Efftinge
See All by Sven Efftinge
Life of a Resource (XtextCON 2015)
svenefftinge
0
350
Future of Xtext (with Sebastian Zarnekow)
svenefftinge
0
19k
Other Decks in Technology
See All in Technology
「AIチャットからもできないの?」と言われたら ~業務アプリをMCP対応するときの認証・認可の勘所
oidfj
0
320
自治体AIコンタクトセンター、何をどこに任せる?~Amazon Connect Customer +Amazon Bedrockの実践知~ / 20261107 Satoshi Torano
shift_evolve
PRO
1
130
GCASアップデート(202607-202610)
techniczna
1
310
cdkd (CDK Direct)
gotok365
4
300
属人化したISMS運用をGitHubとAIで仕組み化した1年間の記録
sioncojp
4
2.5k
AI時代における医療情報システムのセキュリティ / Security of Healthcare IT Systems in the AI Era
henryofficial
0
150
AWSを利用する上で知っておきたい名前解決の話 2026
nagisa53
5
3.5k
Kiro 入門 (1 つのエージェントを、どの画面からでも) | 目指せ Kiro マスター 01
inariku
PRO
6
1.7k
AIが会計業務の伴走者に。 マネーフォワード クラウド会計MCPサーバーで実現するAI前提の新しい業務プロセス
nobitabashi
0
110
BALLAS Technology Deck
ballas_inc
0
570
JAWSコミュニティに 参加して1年経った結果
ssakita
0
130
複数システムが同居した 15 年物の AWS アカウントを解体するための考古学
wa6sn
3
140
Featured
See All Featured
The Power of CSS Pseudo Elements
geoffreycrofte
82
6.6k
Raft: Consensus for Rubyists
vanstee
143
7.9k
A brief & incomplete history of UX Design for the World Wide Web: 1989–2019
jct
2
560
Abbi's Birthday
coloredviolet
5
11k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.2k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
50
10k
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
2
2.1k
GraphQLとの向き合い方2022年版
quramy
50
15k
Amusing Abliteration
ianozsvald
1
390
How GitHub (no longer) Works
holman
316
150k
Faster Mobile Websites
deanohume
310
32k