a journey through mde, dsl and sle (july 2nd, 2015)
TRANSCRIPT
Benoit'Combemale'(Inria &'Univ.'Rennes'1)
http://people.irisa.fr/[email protected]@bcombemale
A'Journey'Through'MDE,'DSL'and'SLE
Or… “Why not writing the code that will generate my code instead of writing my code?!”
(smart)'Cyber'Physical'Systems
Software intensive systems
! 2A Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Aerodynamics
Authorities
Avionics
SafetyRegulations
Airlines
PropulsionSystem
MechanicalStructure
EnvironmentalImpact
NavigationCommunications
Human-Machine
Interaction
3
MultipleConcerns
4
Aerodynamics
Authorities
Avionics
SafetyRegulations
Airlines
PropulsionSystem
MechanicalStructure
EnvironmentalImpact
NavigationCommunications
Human-Machine
Interaction
Heterogeneous Modeling
ModelHDriven Engineering'(MDE)
Distribution
«"Service"Provider"Manager"»
Notification"Alternate"Manager"
«"Recovery"Block"Manager"»
ComplaintRecovery"Block"
Manager
«"Service"Provider"Manager"»
Notification""Manager
«"Service"Provider"Manager"»
Complaint"Alternate"Manager"
«"Service"Provider"Manager"»
Complaint"Manager
«"Acceptance"Test"Manager"»
Notification"Acceptance"Test"
Manager
«"Acceptance"Test"Manager"»
Complaint"Acceptance"Test
Manager
«"Recovery"Block"Manager"»
NotificationRecovery"Block"
Manager
«"Client"»
User"Citizen"Manager
Fault tolerance Roles
ActivitiesViews
Contexts
Security
Functional behavior
Bookstate : StringUser
borrow
return
deliver
setDamaged
reserve
Use case
PlatformModel Design
ModelCode
Model
Change'one'Aspect'and'
AutomaticallyReHWeave:
From:Software:Product:Lines…..to:Dynamically:Adaptive:Systems
! 5A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
ModelHDriven Engineering'(MDE)
! 6
J.'Whittle,'J.'Hutchinson,'and'M.'Rouncefield,'“The$State$of$Practice$in$Model2Driven Engineering,”'IEEE'Software,'vol.'31,'no.'3,'2014,'pp.'79–85.
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
"Perhaps$surprisingly,$the$majority$of$MDE$examples$in$our$study$
followed$domain2specific$modeling$paradigms"
Distribution
«"Service"Provider"Manager"»
Notification"Alternate"Manager"
«"Recovery"Block"Manager"»
ComplaintRecovery"Block"
Manager
«"Service"Provider"Manager"»
Notification""Manager
«"Service"Provider"Manager"»
Complaint"Alternate"Manager"
«"Service"Provider"Manager"»
Complaint"Manager
«"Acceptance"Test"Manager"»
Notification"Acceptance"Test"
Manager
«"Acceptance"Test"Manager"»
Complaint"Acceptance"Test
Manager
«"Recovery"Block"Manager"»
NotificationRecovery"Block"
Manager
«"Client"»
User"Citizen"Manager
Fault tolerance Roles
ActivitiesViews
Contexts
Security
Functional behavior
Bookstate : StringUser
borrow
return
deliver
setDamaged
reserve
Use case
PlatformModel Design
ModelCode
Model
Change'one'Aspect'and'
AutomaticallyReHWeave:
From:Software:Product:Lines…..to:Dynamically:Adaptive:Systems
ModelHDriven Engineering'(MDE)
! 7A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jean!Marc'Jézéquel,'Benoît'Combemale'et'Didier'Vojtisek,'"Ingénierie'Dirigée'par'les'Modèles':'des'concepts'a'la'pratique,"'Ellipses'edition,'février'2012
ModelHDriven Engineering'(MDE)
! 8A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jean!Marc'Jézéquel,'Benoît'Combemale'et'Didier'Vojtisek,'"Ingénierie'Dirigée'par'les'Modèles':'des'concepts'a'la'pratique,"'Ellipses'edition,'février'2012
Editors (textuals, graphicals, …)
Documentation generators
Test generators
Simulators
Analyzers
Refactoring
Checkers (static & dynamics)
Translators
Compilers
Code generators
Etc.
DomainHSpecific Languages (DSLs)
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 10
• Targeted to'a'particular kind of'problem,'with dedicatednotations'(textual or'graphical),'support'(editor,'checkers,'etc.)
• Promises:'more'« efficient »'languages for'resolving a'set'of'specific problems in'a'domain
11
"Language$specially designed$to$perform$a$task$in$a$certain:domain"
"A$formal$processable language$targeting$at$a$specific:viewpoint:or:aspect:of$a$software$system.$Its$semantics:and:notation: is$designed$in$order$to$support$working$with$that$viewpoint$as$good$as$possible"
"A$computer$ language$that's$targeted$to$a$particular$kind$of$
problem,$rather:than:a:general:purpose:language that's$aimed$at$any$kind$of$software$problem.”
DomainHSpecific Languages (DSLs)
! 11A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
A$GPL$provides$notations$that$are$used$to$describe$a$computation$in$a$human2readable$form$that$can$be$translated$into$a$machine2readable$representation.
A$GPL$is$a$formal$notation$that$can$be$used$to$describe$problem$solutions$in$a$precise$manner.
A$GPL$is$a$notation$that$can$be$used$to$write$programs.
A$GPL$is$a$notation$for$expressing$computation.
A$GPL$is$a$standardized$communication$technique$for$expressing$instructions$to$a$computer.$It$is$a$set$of$syntactic$and$semantic$rules$used$to$define$computer$programs.
GPL'(General'Purpose Language)
The'boundary'isn’t'as'clear'as'it'could'be.'DomainH
specificity'is'not'blackHandHwhite,'but'instead'gradual:'a'
language'is'more'or'less'domain'specific
GeneralPL vs. DomainSL
Promises'of'domainHspecific languages
! 14A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Higher'abstractions
Avoid'redundancy
Separation'of'concerns
Use'domain'concepts
Promises'of'domainHspecific languages
! 15A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Benefits
Productivity
Quality
V&V
CommunicationDomainExpert
No'Overhead
PlatformIndependent
« Another lesson we should have'learned from the'recent past isthat the'development of''richer''or''more'powerful''programminglanguages was a'mistake in'the'sense that these baroque'monstrosities,'these conglomerations of'idiosyncrasies,'are'reallyunmanageable,' both mechanically and'mentally.'
I'see a'great future'for'very systematic and'
very modest programming languages »
ACM'Turing'Lecture,'« The'Humble'Programmer »'Edsger W.'Dijkstra 16
aka DomainHSpecific
Languages
aka GeneralHPurposeLanguages
1972
What are'models used for?
! 18A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jon'Whittle,'"What do$449$MDE$Practitioners Think About$MDE?"'EESSMod’11
Which modeling languages are'used?'
! 19A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jon'Whittle,'"What do$449$MDE$Practitioners Think About$MDE?"'EESSMod’11
Which diagrams are'used?
! 20A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jon'Whittle,'"What do$449$MDE$Practitioners Think About$MDE?"'EESSMod’11
! 21A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
John'Hutchinson,'Mark'Rouncefield,'Jon'Whittle,'"Model!driven engineering'practices'in'industry."'ICSE'2011:'633!642
"DSLs:are:far:more:prevalentthan anticipated"
! 22A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
J!M.'Favre,'D.'Gasevic,'R.'Lämmel,'and'E.'Pek.'"Empirical language analysisin'software'linguistics,"'In'Software'Language Engineering,'volume'6563'of'LNCS,'pages'316–326.'Springer,'2011.
"Software:languages:are:software:too"
• An'external DSL'is a'completely separate language and'with itsown custom'syntax/tooling support'(e.g.,'editor,'compiler)
• Language worbenches:$Eclipse$modeling (EMF,$xText,$GMF,$Sirius,$Kermeta,$xCore/xTend…),$DSL$Tools,$Meta$Edit+,$MPS,$GME,$Neverlang,$Delite,$etc.
• An'internal DSL'is more'or'less a'set'of'APIs'written on'top'of'a'host'language
• Extension$mechanisms:$xTend’s active$annotation,$Scala’s LMS,$
extensions$methods (e.g.,$xTend,$Kotlin,$Scala2Virtualized),$plain2
old java$annotation$or$even fluent$interfaces!• API$2>$fluent$API$2>$staging (LMS)
• annotation$2>$active$annotation
External DSLs vs. Internal DSLs
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 23
Both internal and'external DSLs have'strengths and'weaknesses• learning curve,'• cost of'building,'• programmer' familiarity,'• communication'with domain experts,'• mixing in'the'host'language,'• strong expressiveness boundary
External DSLs vs. Internal DSLs
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 24
Textual DSLs vs. Graphical DSLs
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 25
Software'Language Engineering'(SLE)
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 26
• Application'of'systematic,'disciplined,'and'measurable'approaches'to'the'development,'deployment,'use,'and'maintenance'of'software'languages
• Supported'by'various'kind'of'"language'workbench"• Eclipse'EMF,'xText,'Sirius,'GEMOC,'Papyrus• Jetbrain’s MPS• MS'DSL'Tools• Etc.
• Various'shapes'and'ways'to'implement'software'languages• External,'internal'or'embedded'DSLs,'Profile,'etc.• Grammar,'metamodel,'ontology,'etc.
• More and'more'literature,'a'dedicated'Intl.'conference'(ACM'SLE,'cf.'http://www.sleconf.org)…
EMF-based Tools (68 matches in
September, 2012)
Eclipse'Modeling
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 27
The'Kermeta Workbench'(since'2005)
! 28A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jean!Marc'Jézéquel,'Benoit'Combemale,'Olivier'Barais,'Martin'Monperrus,'François'Fouquet,'“Mashup of$metalanguages and$its implementation in$the$Kermeta language workbench,”'SoSyM,'2014.
@aspect(class=Transition)operation fire() : String {
source.owningFSM.currentState := targetresult := output
}
The'Kermeta Workbench'(since'2005)
• Modular'design'of'DSMLs• One'meta!language'per'language'concern'(merge/weave)
• Ecore,'OCL,'Xtend• But'also:'QVTo,'fUML,'Alf,'Ket,'Xsd…
• Static'introduction'mechanism'(aspect)
• Provides'a'model'oriented'action'language'to'support'common'model'manipulation'tasks'
• to'implement'(E)Operation’s'bodies• Imperative,'statically'typed,'object!oriented,'aspect!oriented'(aspect/context,'require),'model!oriented,'DbC,'Unit'testing
• Java'and'Xtend compliant,'and'based'on'EMF• Run'as'Eclipse'plugin'or'as'standard'Java'application
• Efficient'implementation of'DSMLs• Mashup of'the'meta!languages'to'Java'code• Integrated'with'third!party'tools'(EMF'compliant)
! 29A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Jean!Marc'Jézéquel,'Benoit'Combemale,'Olivier'Barais,'Martin'Monperrus,'François'Fouquet,'“Mashup of$metalanguages and$its implementation in$the$Kermeta language workbench,”'SoSyM,'2014.
Software'Language Engineering'(SLE)
! 30
J.'Whittle,'J.'Hutchinson,'and'M.'Rouncefield,'“The$State$of$Practice$in$Model2Driven Engineering,”'IEEE'Software,'vol.'31,'no.'3,'2014,'pp.'79–85.
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
"A$clear$challenge,$then,$is$how$to$integratemultiple$DSLs."
"Rather$than$attempting$to$formalize$a$wide2ranging$domain$(such$
as$financial$applications),$practitioners$should$write$small,$easy2to2maintain$DSLs$and$code$generators.$ In$practice,$however,$multiple$DSLs$are$usually$required,$which$brings$its$own$challenges$in$terms$
of$integration."
Software'Language Engineering'(SLE)
Jean!Marc'Jézéquel,'David'Mendez,'Thomas'Degueule,'Benoit'Combemale,'Olivier'Barais,'"When Systems Engineering$Meets Software$Language Engineering,"'In'Complex Systems Design'&'Management'(CSD&M'14),'Springer,'2014.
All'about'“family'of'languages”!!'!
Core
QueryLanguage
ActionLanguage
ConstraintLanguageFSM
H FSM System
ODE
FSM
Activity
Language InheritanceSubtyping, Model Viewpoint, Generic metaprogramming Globalization of DSLs
HFSM
UML
Rhapsody
Stateflow
HT FSM
Language Modularization and Composition, Language Variability Management
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 31
Research'Topics'about'SLE'in'DiverSE
• Design'&'Implementation'of'DSLs• Modularity,'customization,'reuse,'variability'management'of'DSLs• Domain!specific'meta!languages'(executability,'concurrency,'coordination)• DSL'executability,'model'simulation'and'debug,'and'trace'management• Language'adaptability
• Globalization'of'DSLs• Concurrent'execution'of'heterogeneous'models• Integration'of'scientific'models'and'engineering'models
! 32A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
OPEN WORLD
Feature A
Feature B Feature B
F. D F. D F. D F. D F. D F. D
Variability model
L1 L2
L3 L4
L1
L3 L4L2
CLOSED WORLD
Language Manipulation
• Evolution• Extension• Restriction• Customization• Assembly
Variability-based development model for
DSLs
• Variability modeling
• Components-based languages development
Families of Languages
Variants
Language derivation
L6
Typing Theoryfor Agile Modeling
• Language interfaces• Model polymorphism• Viewpoints management
MELANGE
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 33
A language-based, model-oriented
programming language
Melange
! 34A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
The GEMOC Studio
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 H 35
! 36A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
• Graphical'animation
• Breakpoint'definition'on'model'element
• MultiHdimensional'and'efficient'trace'
management
• Model'debugging'facilities'(incl.,'timeline,'
step'backward,'stimuli'management,'etc.)
• Concurrency'simulation'and'formal'analysis
Activity Diagram Debugger
https://github.com/gemoc/activitydiagram
! 37A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015
Arduino Designer (& Debugger)
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 38
https://github.com/gemoc/farmingmodeling
Farming System Modeling
WrapHup
A:Journey:Through:MDE,:DSL:and:SLE H Benoit'Combemale (INRIA'and'Univ.'Rennes'1)'H July'2nd,'2015 ! 39
• Model$Driven$Engineering
• Addresses$accidental$complexity$
• Separation$of$concerns$with$models
• Abstraction$with$DS(M)Ls
� Software$Language Engineering• Tools$and$methods$for$language$design,$implementation,$$
deployment,$use$and$evolution
• Tools:$various$language$workbenches
• Methods:$various$shapes$and$ways$to$implement$languages
• Next$grand$challenge:Globalization of'Modeling'Languages
Cf.'the'GEMOC'initiativehttp://gemoc.org