Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
MPS
Domain Specific Languages
with pleasure
Václav Pech
JetBrains MPS
High thoughts must have high language.
Aristophanes
Your vocabulary reflects the way you think
Seth Godin
[Embedded Software]
mbeddr
[Data analysis]
MetaR
[Business Application]
Insurance Configuration Tool
[Business Application]
Insurance Configuration Tool
<no variables> <no parent>
<no libraries>
<no business objects>
<no parent>
[Business Application]
Insurance Configuration...
Notations for DSLs
● Text
● Diagrams
● Tables
● Forms
● Mixtures of all
● …
The number and the type of the basic colour
words of a language determine how one sees the
rain bow
Programs are trees
R
A B
C D
G
R
E F
Programs are trees
R
A B
C D
G
R
E F
Children have roles
R
A IfStatement
Expr StmtList
G
R
E F
condition body
References cross the tree
R
Routine def B
Call D
G
R
E F
Languages are sets of concepts
C1
C2
C3
Cn
L1
L2
Programs and Languages
R
A B
C D
G
R
E F
C1
C2
C3
Cn
L
Models consist of nodes
Meta-models consist of concepts
IntelliJ IDEA inspections
Groovy AST transformations
Groovy AST transformations
There's no life without trees
● Extending IDEs
● External DSLs
● Internal DSLs in modern languages
● Groovy AST transforma...
Notations for DSLs
● Text
● Diagrams
● Tables
● Forms
● Mixtures of all
● …
Parsing is the bottleneck
… of language expressiveness
Editing text
Parsing
Programs are trees
R
A B
C D
G
R
E F
WhileLoop
MethodDef
MethodCall
L IfStatement
Models consist of nodes
Meta-models cons...
Editing trees directly
Projecting
by Jens Nerche @jensnerche
Rich syntaxes
Combine languages
Multiple notations
Parsing is the bottleneck
… of language expressiveness
● Limits the possible syntaxes
● Allows only one editable code visu...
Aspects of language definition
● Abstract syntax
● Concrete syntax (editor)
● Static semantics
● Constraints
● Type-system...
Books
● http://books.campagnelab.org
● http://dslbook.org
https://www.jetbrains.com/mps/publications
Books
● http://books.campagnelab.org
● http://dslbook.org
← He is a Biologist!
https://www.jetbrains.com/mps/publications
The limits of language are the limits of one's world
Ludwig Wittgenstein
Questions
Want more?
http://www.jetbrains.com/mps
@vaclav_pech
Image credits
http://www.flickr.com/photos/horiavarlan/4329908160/sizes/m/in/photostream/
http://www.flickr.com/photos/pin...
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Domain Specific Language with pleasure
Upcoming SlideShare
Loading in …5
×

Domain Specific Language with pleasure

946 views

Published on

An introduction into Domain Specific Languages with JetBrains MPS presented at GeeCON Prague 2015

Published in: Software
  • Be the first to comment

Domain Specific Language with pleasure

  1. 1. MPS Domain Specific Languages with pleasure Václav Pech
  2. 2. JetBrains MPS High thoughts must have high language. Aristophanes
  3. 3. Your vocabulary reflects the way you think Seth Godin
  4. 4. [Embedded Software] mbeddr
  5. 5. [Data analysis] MetaR
  6. 6. [Business Application] Insurance Configuration Tool
  7. 7. [Business Application] Insurance Configuration Tool
  8. 8. <no variables> <no parent> <no libraries> <no business objects> <no parent> [Business Application] Insurance Configuration Tool
  9. 9. Notations for DSLs ● Text ● Diagrams ● Tables ● Forms ● Mixtures of all ● …
  10. 10. The number and the type of the basic colour words of a language determine how one sees the rain bow
  11. 11. Programs are trees R A B C D G R E F
  12. 12. Programs are trees R A B C D G R E F
  13. 13. Children have roles R A IfStatement Expr StmtList G R E F condition body
  14. 14. References cross the tree R Routine def B Call D G R E F
  15. 15. Languages are sets of concepts C1 C2 C3 Cn L1 L2
  16. 16. Programs and Languages R A B C D G R E F C1 C2 C3 Cn L Models consist of nodes Meta-models consist of concepts
  17. 17. IntelliJ IDEA inspections
  18. 18. Groovy AST transformations
  19. 19. Groovy AST transformations
  20. 20. There's no life without trees ● Extending IDEs ● External DSLs ● Internal DSLs in modern languages ● Groovy AST transformations ● Scala macros ● Lisp, Clojure macros ● Lombok
  21. 21. Notations for DSLs ● Text ● Diagrams ● Tables ● Forms ● Mixtures of all ● …
  22. 22. Parsing is the bottleneck … of language expressiveness
  23. 23. Editing text Parsing
  24. 24. Programs are trees R A B C D G R E F WhileLoop MethodDef MethodCall L IfStatement Models consist of nodes Meta-models consist of concepts
  25. 25. Editing trees directly Projecting
  26. 26. by Jens Nerche @jensnerche Rich syntaxes
  27. 27. Combine languages
  28. 28. Multiple notations
  29. 29. Parsing is the bottleneck … of language expressiveness ● Limits the possible syntaxes ● Allows only one editable code visualization ● Complicates combining languages
  30. 30. Aspects of language definition ● Abstract syntax ● Concrete syntax (editor) ● Static semantics ● Constraints ● Type-system ● Dataflow ● Execution semantics / Generator ● IDE support
  31. 31. Books ● http://books.campagnelab.org ● http://dslbook.org https://www.jetbrains.com/mps/publications
  32. 32. Books ● http://books.campagnelab.org ● http://dslbook.org ← He is a Biologist! https://www.jetbrains.com/mps/publications
  33. 33. The limits of language are the limits of one's world Ludwig Wittgenstein
  34. 34. Questions Want more? http://www.jetbrains.com/mps @vaclav_pech
  35. 35. Image credits http://www.flickr.com/photos/horiavarlan/4329908160/sizes/m/in/photostream/ http://www.flickr.com/photos/pink_floyd/2409134519/sizes/m/in/photostream/ http://www.flickr.com/photos/atache/4124732863/sizes/m/in/photostream/ http://www.flickr.com/photos/a_ninjamonkey/3294014627/sizes/m/in/photostream/ http://www.flickr.com/photos/carlc/1968636137/ http://www.flickr.com/photos/tasuki/3503304405/sizes/m/in/photostream/ http://www.flickr.com/photos/bmwccgb/5069454884/sizes/m/in/photostream/ http://www.flickr.com/photos/rpmarks/3932013183/sizes/m/in/photostream/ http://www.flickr.com/photos/orqwith/4325166853/ https://www.flickr.com/photos/charlestilford/732688216

×