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
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
More Decks by Sven Efftinge
See All by Sven Efftinge
Life of a Resource (XtextCON 2015)
svenefftinge
0
340
Future of Xtext (with Sebastian Zarnekow)
svenefftinge
0
19k
Other Decks in Technology
See All in Technology
MulticaとPi Coding Agentで、小規模OSSを30本同時運用した流れ
eiei114
0
140
LLM・AIエージェントシステムベストプラクティス
shibuiwilliam
6
1.6k
AIペネトレーションテスト・ セキュリティ検証「AgenticSec」紹介資料
laysakura
2
9.4k
Kiro WebとCloud Sessions
nagisa53
2
150
安全性・開発速度・ユーザー体験の あいだで考える 事業会社のプロダクトセキュリティ
mixi_engineers
PRO
0
100
NANDでも描画したい!
nichica906
3
590
AI開発に用いられるHPC技術について
gpuunite_official
0
260
Kiro入門|仕様駆動開発で変わるAI時代の開発スタイル
cmkudo
0
340
AIに持続⼒を与える 判断の⻑期記憶設計
eiei114
1
670
Android skills に学ぶ
kokiko
0
160
会社紹介資料 / Sansan Company Profile
sansan33
PRO
24
430k
【GCC2026】大規模言語モデルを活用した内製検索サービスの社内展開や業務活用
bandainamcostudios
PRO
0
520
Featured
See All Featured
Automating Front-end Workflow
addyosmani
1369
210k
Bash Introduction
62gerente
615
220k
Evolving SEO for Evolving Search Engines
ryanjones
0
260
ラッコキーワード サービス紹介資料
rakko
1
4.5M
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
287
14k
Stop Working from a Prison Cell
hatefulcrawdad
274
21k
Building Applications with DynamoDB
mza
96
7.2k
How Software Deployment tools have changed in the past 20 years
geshan
1
34k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
580
Why Our Code Smells
bkeepers
PRO
340
58k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6k
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