MPS: Extend Your { Language | IDE } to Your Domain and System Engineer Niko Stotz, niko.stotz@altran.com 2019-04-18
DSLs M P S : E x t e n d Y o u r { L a n g u a g e | I D E }
GPLs vs. DSLs General Purpose Languages (GPLs) Domain Specific Languages (DSLs) • C • SQL • Java • HTML • Python • JSON • JavaScript • UML Class Diagram • F# • State Machine • … • IFTTT • Excel • Weather Report • Food Recipe • Insurance Product MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Characteristics of DSLs Language Domain Specific • Syntax • Embedded in context • Only relevant concepts • Grammar • Recognizable by experts • Complete for (part of) domain • Formal • Known concepts, terminology, and structure • Defined semantic MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
DSLs vs. “modeling” “modeling” DSLs • • Good tooling: Build new language in 30 min Universal Unified Modeling Language • 4GL / CASE systems • More than generation: Validation, Simulation, Testing, … Adjust language to Inflexible Domain Adjust development to language / tool Company Bad reputation Project MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
MPS M P S : E x t e n d Y o u r { L a n g u a g e | I D E }
MPS: The state-of-the-art, industrial-quality {language | MDE | DSL} workbench • Meta Programming System by JetBrains https://www.jetbrains.com/mps/ • Implemented in Java, Same base as IntelliJ (IDEA Platform) • Open Source https://github.com/JetBrains/MPS • ~ 10 devs for 15 years MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Main advantages: Projectional Editing + Language Composition User Perspective Developer Perspective Projectional Editing Language Composition MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Parsing translates between user-facing text and model Parsing Projection Parser Serializer MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Projectional Editing works directly on model Parsing Projection Projection Engine Parser Serializer MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Projectional Editing enables Notational Freedom Text Embedded Text Form Math Diagram Table Tree Overlay MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Projectional Editing enables multiple viewpoints on same model MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Language Composition enables Separation of Concerns • Extension • Combination • Reuse • Embedding http://voelter.de/data/pub/Voelter-GTTSE-MPS.pdf MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Language Composition: Embedding permits two-way interaction between independent languages SQL SQL ⊕ C SQL ⊕ PHP C PHP C ⊕ SQL MPS: Extend Your { Language | IDE } to Your Domain and System Engineer 2 0 1 9
Generator: Chains of model-to-model transformations enable flexible composition «Java2k» «Statemachine» «Java» «Text» m2m m2m m2t MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Generator: Chains of model-to-model transformations enable flexible composition «Java2k» «Statemachine» «Java» «Text» m2m m2m m2t «JavaActor» MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Generator: Implemented through annotated target-language instance Input: «Statemachine» Output: «Java» class ExampleClass extends AbstractState { private final Context ctx = ExampleContext .get(); void transition() { } } MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Generator: Implemented through annotated target-language instance Input: «Statemachine» Output: «Java» node.name class [ExampleClass] extends AbstractState { node.ref(GenCtx) private final Context ctx = [->ExampleContext].get(); COPY_SRCL(node.transitions) void transition() { } } MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Demo M P S : E x t e n d Y o u r { L a n g u a g e | I D E }
Zurich Insurance: Word Pseudo-code to MPS MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Other notable MPS Features • Validation • Typesystem • Quickfixes a.k.a. Intentions • Data flow / control flow • VCS integration • Language evolution MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Links DSL MPS • Introduction + Links • MPS Homepage http://dsl-course.org/ https://www.jetbrains.com/mps/ • Software Language Engineering • MPS Link collection Body of Knowledge https://mps.rocks/ http://slebok.github.io/ • MPS Community NL http://mps-community.nl/ MPS: Extend Your { Language | IDE } to Your Domain and System Engineer
Q & A M P S : E x t e n d Y o u r { L a n g u a g e | I D E }
M P S : E x t e n d Y o u r { L a n g u a g e | I D E }
Recommend
More recommend