in External DSLs WGT 2011 Markus Voelter - - PowerPoint PPT Presentation

in external dsls
SMART_READER_LITE
LIVE PREVIEW

in External DSLs WGT 2011 Markus Voelter - - PowerPoint PPT Presentation

The State of the Art in External DSLs WGT 2011 Markus Voelter Independent/itemis voelter@acm.org A li%le History DSLs Example: Fountains


slide-1
SLIDE 1

The ¡State ¡of ¡the ¡Art ¡ in ¡External ¡DSLs ¡

WGT ¡2011 ¡

Markus ¡Voelter ¡ Independent/itemis ¡ voelter@acm.org ¡
slide-2
SLIDE 2

Œ ¡A ¡li%le ¡History ¡  ¡DSLs ¡ Ž ¡Example: ¡Fountains ¡  ¡Programming ¡vs. ¡Modeling ¡  ¡ProjecAonal ¡EdiAng ¡ ‘ ¡Example: ¡Embedded ¡Development ¡

slide-3
SLIDE 3

Œ ¡

A ¡liGle ¡History ¡

slide-4
SLIDE 4

programming ¡ close ¡to ¡the ¡hardware ¡

started ¡

abstracLons ¡ ¡ ¡ ¡compuLng ¡

∼ ¡

¡ ¡ ¡chips ¡

slide-5
SLIDE 5

abstracLons ¡ ¡ ¡ ¡compuLng ¡

∼ ¡

¡ ¡ ¡bits ¡

slide-6
SLIDE 6

¡ ¡ ¡C ¡

abstracLons ¡ ¡ ¡ ¡compuLng ¡

∼ ¡

slide-7
SLIDE 7

¡ ¡ ¡Java ¡

abstracLons ¡ ¡ ¡ ¡compuLng? ¡

∼ ¡

slide-8
SLIDE 8

¡ ¡ ¡SQL ¡

abstracLons ¡ ¡ ¡ ¡compuLng? ¡

∼ ¡

slide-9
SLIDE 9
slide-10
SLIDE 10
slide-11
SLIDE 11

general ¡purpose ¡

slide-12
SLIDE 12

domain ¡specific ¡

slide-13
SLIDE 13

effecLve++ ¡ specialized, ¡limited ¡ used ¡by ¡experts ¡ together ¡with ¡other ¡ ¡ ¡ ¡ ¡specialized ¡tools ¡ tailor ¡made ¡

slide-14
SLIDE 14

 ¡

Domain ¡Specific ¡Languages ¡

slide-15
SLIDE 15

DSL ¡

A ¡DSL ¡is ¡a ¡focussed, ¡processable ¡ language ¡for ¡describing ¡a ¡specific ¡ concern ¡when ¡building ¡a ¡system ¡in ¡a ¡ specific ¡domain. ¡The ¡abstracLons ¡and ¡ notaLons ¡used ¡are ¡natural/suitable ¡for ¡ the ¡stakeholders ¡who ¡specify ¡that ¡ parAcular ¡concern. ¡

slide-16
SLIDE 16

map ¡

slide-17
SLIDE 17

DSL ¡Program ¡ GPL ¡Program ¡

(aka ¡Model) ¡

map ¡ automated! ¡

slide-18
SLIDE 18

map ¡

GeneraLon ¡

TransformaLon ¡ CompilaLon ¡

InterpretaLon ¡

slide-19
SLIDE 19
slide-20
SLIDE 20

Analysing ¡Domains ¡ ¡ ¡ ¡Defining ¡Languages ¡

AcLviLes ¡

¡ ¡ ¡ ¡ ¡ ¡Building ¡Editors ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Transforming ¡Models ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Building ¡Generators ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Building ¡Frameworks ¡

AdapLng/SelecLng ¡

slide-21
SLIDE 21

Analysing ¡Domains ¡ ¡ ¡ ¡Defining ¡Languages ¡

AcLviLes ¡

¡ ¡ ¡ ¡ ¡ ¡Building ¡Editors ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Transforming ¡Models ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Building ¡Generators ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡Building ¡Frameworks ¡

AdapLng/SelecLng ¡

… ¡and ¡using ¡all ¡of ¡that ¡to ¡build ¡apps ¡ ¡

slide-22
SLIDE 22

Ž ¡

Example ¡1: ¡ Fountain ¡Control ¡

slide-23
SLIDE 23

¡CONTEXT ¡

slide-24
SLIDE 24

¡SOLUTION ¡ Hardware ¡Structure ¡

slide-25
SLIDE 25

¡SOLUTION ¡ Behaviour ¡

slide-26
SLIDE 26

¡SOLUTION ¡ Plus: ¡ In-­‑IDE ¡Simulator ¡ Unit ¡Test ¡Support ¡

slide-27
SLIDE 27

TOOLS ¡ Eclipse ¡Modeling ¡ Eclipse ¡Xtext ¡

slide-28
SLIDE 28

 ¡

Programming ¡vs. ¡ Modeling ¡

slide-29
SLIDE 29

Modeling ¡Tools ¡ ¡ Programming ¡Tools ¡ != ¡

Different ¡Worlds ¡

slide-30
SLIDE 30

Modeling ¡Tool ¡ Modeling ¡Tool ¡ != ¡

Different ¡Worlds ¡

slide-31
SLIDE 31

Different ¡Worlds ¡

Mix ¡Models ¡and ¡Programs ¡

slide-32
SLIDE 32

Different ¡Worlds ¡

AST ¡NavigaLon ¡& ¡Query ¡ Mix ¡Models ¡and ¡Programs ¡

slide-33
SLIDE 33

Different ¡Worlds ¡

AST ¡NavigaLon ¡& ¡Query ¡ Mix ¡Models ¡and ¡Programs ¡ Code ¡Constraints ¡

slide-34
SLIDE 34

Why ¡

the ¡difference? ¡

slide-35
SLIDE 35

History? ¡

slide-36
SLIDE 36

Modeling ¡ Programming ¡

… ¡(Mostly) ¡Textual ¡ ¡ ¡ ¡ ¡ ¡NotaLons ¡

¡

… ¡Concrete ¡Syntax ¡ ¡ ¡ ¡ ¡ ¡Storage ¡

¡

… ¡(Fancy) ¡ASCII ¡Editors ¡

¡

… ¡Read-­‑Only ¡ ¡ ¡ ¡ ¡ ¡VisualizaLons ¡ ¡

slide-37
SLIDE 37

Modeling ¡

… ¡(Mostly) ¡Graphical ¡ ¡ ¡ ¡ ¡NotaLons ¡

¡

… ¡Abstract ¡Syntax ¡ ¡ ¡ ¡ ¡ ¡Storage ¡

¡

… ¡ProjecLng ¡Editors ¡

¡

… ¡Different ¡editable ¡ ¡ ¡ ¡ ¡views ¡for ¡model ¡ ¡

Programming ¡

… ¡(Mostly) ¡Textual ¡ ¡ ¡ ¡ ¡ ¡NotaLons ¡

¡

… ¡Concrete ¡Syntax ¡ ¡ ¡ ¡ ¡ ¡Storage ¡

¡

… ¡(Fancy) ¡ASCII ¡Editors ¡

¡

… ¡Read-­‑Only ¡ ¡ ¡ ¡ ¡ ¡VisualizaLons ¡ ¡

slide-38
SLIDE 38

Why ¡

the ¡difference? ¡

slide-39
SLIDE 39

It ¡is ¡Lme ¡for ¡… ¡

slide-40
SLIDE 40

… ¡a ¡Different ¡PerspecLve ¡

slide-41
SLIDE 41

Programming ¡

the ¡way ¡we ¡do ¡

Modeling? ¡ Modeling ¡

the ¡way ¡we ¡do ¡

Programming? ¡

slide-42
SLIDE 42

Modeling ¡ Programming ¡ Programming ¡ Modeling ¡

== ¡ == ¡

slide-43
SLIDE 43

We ¡don‘t ¡want ¡to ¡

we ¡want ¡to ¡

model, ¡

program! ¡

slide-44
SLIDE 44

We ¡don‘t ¡want ¡to ¡

we ¡want ¡to ¡

model, ¡

program! ¡

… ¡at ¡different ¡levels ¡of ¡abstacLon ¡ … ¡from ¡different ¡viewpoints ¡ … ¡integrated! ¡

slide-45
SLIDE 45

We ¡don‘t ¡want ¡to ¡

we ¡want ¡to ¡

model, ¡

program! ¡

… ¡with ¡different ¡degrees ¡of ¡ ¡ … ¡with ¡suitable ¡notaLons ¡ … ¡with ¡suitable ¡expressiveness ¡ domain-­‑specificity ¡

slide-46
SLIDE 46

We ¡don‘t ¡want ¡to ¡

we ¡want ¡to ¡

model, ¡

program! ¡

precise ¡and ¡tool ¡processable ¡ And ¡always: ¡

slide-47
SLIDE 47

Programming ¡ ¡ Languages ¡

are ¡not ¡

  • enough. ¡

MODULAR ¡

slide-48
SLIDE 48

Programming ¡ ¡ Languages ¡

are ¡not ¡

  • enough. ¡

COMPOSABLE ¡

slide-49
SLIDE 49

Programming ¡ ¡ Languages ¡

are ¡not ¡

  • enough. ¡

CONFIGURABLE ¡

slide-50
SLIDE 50

Programming ¡ ¡ Languages ¡

are ¡not ¡

  • enough. ¡

ADAPTABLE ¡

slide-51
SLIDE 51

Programming ¡ ¡ Language ¡Syntax ¡

is ¡not ¡

  • enough. ¡

FLEXIBLE ¡

slide-52
SLIDE 52

L ¡

a ¡ b ¡ c ¡ d ¡ e ¡ f ¡ g ¡ h ¡ i ¡ j ¡ k ¡ m ¡ n ¡
  • ¡

with ¡many ¡first ¡class ¡concepts! ¡

Big ¡Language? ¡

slide-53
SLIDE 53

L ¡

α ¡ β ¡ λ ¡ ω ¡ δ ¡ Small ¡Language? ¡

and ¡poweful ¡concepts ¡ with ¡a ¡few, ¡orthogonal ¡

slide-54
SLIDE 54 my ¡L ¡

α ¡ β ¡

a ¡ b ¡ c ¡ d ¡ e ¡ f ¡ g ¡ h ¡ i ¡ j ¡ k ¡ l ¡

Modular ¡Language ¡

composable ¡ ¡concepts ¡ with ¡many ¡opLonal, ¡

slide-55
SLIDE 55

Like ¡frameworks ¡ ¡ and ¡libraries, ¡ ¡ but ¡with ¡syntax ¡ and ¡IDE ¡support ¡

Modular ¡Language ¡

slide-56
SLIDE 56

 ¡

ProjecLonal ¡ EdiLng ¡

slide-57
SLIDE 57

Parser-­‑based ¡

text ¡ … ¡to ¡tree ¡ … ¡to ¡text ¡

slide-58
SLIDE 58

ProjecLonal ¡

tree ¡ … ¡to ¡text-­‑lookalike ¡(editor) ¡ … ¡to ¡other ¡trees ¡… ¡[*] ¡ … ¡to ¡text ¡ ¡

slide-59
SLIDE 59

Programming ¡as ¡Modeling ¡

… ¡(Mostly) ¡Graphical ¡ ¡ ¡ ¡ ¡NotaLons ¡

¡

… ¡Abstract ¡Syntax ¡ ¡ ¡ ¡ ¡ ¡Storage ¡

¡

… ¡ProjecLng ¡Editors ¡

¡

… ¡Different ¡editable ¡ ¡ ¡ ¡ ¡views ¡for ¡model ¡ ¡

slide-60
SLIDE 60

Programming ¡as ¡Modeling ¡

… ¡(Mostly) ¡Graphical ¡Any ¡kind ¡of ¡ ¡ ¡ ¡ ¡NotaLons ¡

¡

… ¡Abstract ¡Syntax ¡ ¡ ¡ ¡ ¡ ¡Storage ¡

¡

… ¡ProjecLng ¡Editors ¡

¡

… ¡Different ¡editable ¡ ¡ ¡ ¡ ¡views ¡for ¡model ¡ ¡

slide-61
SLIDE 61

Language ¡

There‘s ¡no ¡parsing. ¡ Unique ¡Language ¡Element ¡IdenLty. ¡ Unlimted ¡language ¡composiLon. ¡

ComposiLon ¡

slide-62
SLIDE 62

Textual ¡ Graphical ¡ Semi-­‑Graphical ¡

treated ¡the ¡same ¡ can ¡be ¡mixed ¡

like ¡ASCII ¡ } ¡ box ¡& ¡line ¡ mathemaLcal ¡

Flexible ¡

NotaLons ¡

slide-63
SLIDE 63

AutomaLc ¡

IDE ¡Extension ¡

tool ¡support ¡is ¡inherent ¡ for ¡languages ¡build ¡with ¡ projecLonal ¡tools ¡

language ¡definiLon ¡ IDE ¡definiLon ¡

implies ¡
slide-64
SLIDE 64

MulLple ¡

NotaLons ¡

… ¡for ¡the ¡same ¡concepts ¡ e.g. ¡in ¡different ¡contexts ¡

  • r ¡for ¡different ¡tasks ¡
slide-65
SLIDE 65

ParLal ¡

ProjecLons ¡

… ¡different ¡views ¡ … ¡for ¡different ¡roles/people ¡ … ¡only ¡a ¡parLcular ¡variant ¡

slide-66
SLIDE 66

Programs ¡

Live ¡

think: ¡spreadsheet ¡ a ¡change ¡to ¡one ¡part ¡of ¡program ¡ can ¡lead ¡to ¡(dependent) ¡changes ¡ in ¡other ¡parts ¡

slide-67
SLIDE 67

Tree ¡EdiLng ¡

… ¡try ¡to ¡make ¡it ¡feel ¡like ¡text ¡ … ¡takes ¡some ¡gelng ¡used ¡to ¡

but: ¡for ¡more ¡flexible ¡notaLons ¡ ¡ a ¡more ¡general ¡ediLng ¡paradigm ¡ ¡ is ¡needed ¡

… ¡is ¡different ¡from ¡ediLng ¡text ¡

slide-68
SLIDE 68

Infrastructure ¡

IntegraLon ¡

… ¡diff/merge ¡must ¡be ¡in ¡tool ¡ … ¡exisLng ¡text ¡tools ¡don‘t ¡work ¡ … ¡storage ¡is ¡not ¡text ¡

slide-69
SLIDE 69

Proprietary ¡

Tools ¡

… ¡no ¡interop ¡ … ¡no ¡standards ¡

slide-70
SLIDE 70
slide-71
SLIDE 71

‘ ¡

Example ¡2: ¡ Embedded ¡Systems ¡

slide-72
SLIDE 72

Example ¡2: ¡

Embedded ¡Systems ¡ ¡

slide-73
SLIDE 73

¡EXAMPLE ¡CASE ¡

slide-74
SLIDE 74

¡SOLUTION ¡

slide-75
SLIDE 75

¡SOLUTION ¡

slide-76
SLIDE 76

¡SOLUTION ¡

slide-77
SLIDE 77

TOOLS ¡ JetBrains ¡MPS ¡

slide-78
SLIDE 78 web ¡ ¡ email ¡ ¡ twiGer ¡ ¡ xing ¡ linkedin ¡ www.voelter.de ¡ voelter@acm.org ¡ markusvoelter ¡ ¡ hGp://www.xing.com/profile/Markus_Voelter ¡ hGp://www.linkedin.com/pub/0/377/a31 ¡ .coordinates ¡

THE ¡END. ¡