melange: a meta-language for modular and reusable ... › pdf › sle15melange.pdf · melange: a...
TRANSCRIPT
Melange: a Meta-language for
Modular and Reusable
Development of DSLsThomas Degueule, Benoit Combemale, Arnaud Blouin, Olivier Barais, Jean-Marc Jézéquel
Melange: a Meta-language for Modular and Reusable Development of DSLs 2
Melange: a Meta-language for Modular and Reusable Development of DSLs 3
DSLs specificities
• Closely evolve with the domain• Extended, shrunk, customized, etc.• Quick prototyping, small development teams
Melange: a Meta-language for Modular and Reusable Development of DSLs 4
Software Language Engineering
• Breathing software engineering into languages
• In this talk: reuse, modularity• Goal: reduce engineering costs
• Instead of starting from scratch, can we reuse previously-defined language artifacts?
• But, is reuse relevant in a domain-specific context?
Crane et al., UML vs. classical vs. rhapsody statecharts: not all models are created equal, SoSyM, 2007
Reuse is not enough! Context matters!
Imported artifacts may not fit exactlydomain-specific requirements
Finely tune the imported artifacts and theresulting languages withcustomization facilities
Melange: a Meta-language for Modular and Reusable Development of DSLs 6
• A metamodel specifies the AS
Melange: a Meta-language for Modular and Reusable Development of DSLs 6
• A metamodel specifies the AS
• Sem consists of computation steps and runtime data
Melange: a Meta-language for Modular and Reusable Development of DSLs 6
• A metamodel specifies the AS
• Sem consists of computation steps and runtime data
• Aspect-oriented modeling: Semis woven as methods in the AS
• Based on static introduction
• Interpreter pattern
Jézéquel et al., Mashup of metalanguages
and its implementation in the kermeta
language workbench, SoSyM, 2013
Melange: a Meta-language for Modular and Reusable Development of DSLs 7
Melange: a Meta-language for Modular and Reusable Development of DSLs 7
Melange: a Meta-language for Modular and Reusable Development of DSLs 7
Inspired by eg. Erdweg et al., Language Composition Untangled, LDTA, 2012
Melange: a Meta-language for Modular and Reusable Development of DSLs 8
Melange: a Meta-language for Modular and Reusable Development of DSLs 8
Steel et al., On Model Typing, SoSyM, 2007
Guy et al., On Model Subtyping, ECMFA, 2012
Running Example: a Simple State Machine Language in Melange
Melange: a Meta-language for Modular and Reusable Development of DSLs 9
Melange: a Meta-language for Modular and Reusable Development of DSLs 9
Melange: a Meta-language for Modular and Reusable Development of DSLs 9
Melange: a Meta-language for Modular and Reusable Development of DSLs 9
Melange: a Meta-language for Modular and Reusable Development of DSLs 10
Melange: a Meta-language for Modular and Reusable Development of DSLs 10
Melange: a Meta-language for Modular and Reusable Development of DSLs 11
Melange: a Meta-language for Modular and Reusable Development of DSLs 11
Melange: a Meta-language for Modular and Reusable Development of DSLs 12
Melange: a Meta-language for Modular and Reusable Development of DSLs 12
Melange: a Meta-language for Modular and Reusable Development of DSLs 12
Melange: a Meta-language for Modular and Reusable Development of DSLs 13
Melange: a Meta-language for Modular and Reusable Development of DSLs 13
Melange: a Meta-language for Modular and Reusable Development of DSLs 13
Melange: a Meta-language for Modular and Reusable Development of DSLs 14
Melange: a Meta-language for Modular and Reusable Development of DSLs 14
Melange: a Meta-language for Modular and Reusable Development of DSLs 14
A Language Workbench
▪ An open-source (EPL) language workbench
▪ or… a language-based, model-oriented language for DSL engineering
▪ An implementation of the algebra
▪ Supported by a model-oriented type sytem
▪ Based on Xtext
▪ Seamlessly integrated with the EMF ecosystem
▪ Bundled as a set of Eclipse plug-ins
Melange: a Meta-language for Modular and Reusable Development of DSLs 15
▪ Abstract syntax: Ecore (EMOF)
▪ Merging: Customized UML PackageMerge1
▪ Trading UML specificities with EMOF specificities
▪ Support for renaming
▪ Slicing: Kompren2
▪ Operational semantics: K3 (Xtend on steroids)
Melange: a Meta-language for Modular and Reusable Development of DSLs 16
Dingel et al., Understanding and Improving UML PackageMerge, SoSyM, 2008
Blouin et al., Kompren: Modeling and generating model slicers, SoSyM, 2012
1
2
Melange: a Meta-language for Modular and Reusable Development of DSLs 38
▪ Abstract syntax: Ecore (EMOF)
▪ Merging: Customized UML PackageMerge1
▪ Trading UML specificities with EMOF specificities
▪ Support for renaming
▪ Slicing: Kompren2
▪ Operational semantics: K3 (Xtend on steroids)
Melange: a Meta-language for Modular and Reusable Development of DSLs 16
Dingel et al., Understanding and Improving UML PackageMerge, SoSyM, 2008
Blouin et al., Kompren: Modeling and generating model slicers, SoSyM, 2012
1
2
Pointcut
Advice
Melange: a Meta-language for Modular and Reusable Development of DSLs 17
Melange: a Meta-language for Modular and Reusable Development of DSLs 17
An Executable Modeling Language for the Internet of Things
Melange: a Meta-language for Modular and Reusable Development of DSLs 18
IDL
Modelsensors’
interfaces
Behavior
Modelsensors’
control flow
Actions
Expresssensors’ action
cf. fUML, ThingML, etc.
Melange: a Meta-language for Modular and Reusable Development of DSLs 18
IDL
Modelsensors’
interfaces
Behavior
Modelsensors’
control flow
Actions
Expresssensors’ actions
Ecore ActivityDiagram
FromEclipse
FromTTC’15
FromGithub
cf. fUML, ThingML, etc.
▪ Comparison with a top-down approach
▪ No runtime penalty
▪ Reuse and customization operators ease the development
▪ Glue: ~30 LoC (mainly Lua/AD context translation)
Melange: a Meta-language for Modular and Reusable Development of DSLs 19
▪ Viewpoints engineering
▪ Fine-grained modularity: language units / features / modules
Melange: a Meta-language for Modular and Reusable Development of DSLs 20
▪ Feel free to ask for a demonstration
Melange: a Meta-language for Modular and Reusable Development of DSLs 21
http://melange-lang.org