MPS: Extend Your { Language | IDE } to Your Domain and System - - PowerPoint PPT Presentation

mps extend your language ide to your
SMART_READER_LITE
LIVE PREVIEW

MPS: Extend Your { Language | IDE } to Your Domain and System - - PowerPoint PPT Presentation

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


slide-1
SLIDE 1

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Niko Stotz, niko.stotz@altran.com

2019-04-18

slide-2
SLIDE 2 M P S : E x t e n d Y
  • u
r { L a n g u a g e | I D E }

DSLs

slide-3
SLIDE 3

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

GPLs vs. DSLs

General Purpose Languages (GPLs)

  • C
  • Java
  • Python
  • JavaScript
  • F#

Domain Specific Languages (DSLs)

  • SQL
  • HTML
  • JSON
  • UML Class Diagram
  • State Machine
  • IFTTT
  • Excel
  • Weather Report
  • Food Recipe
  • Insurance Product
slide-4
SLIDE 4

Characteristics of DSLs

Language

  • Syntax
  • Grammar
  • Formal
  • Defined semantic

Domain

  • Embedded in context
  • Recognizable by experts
  • Known concepts,

terminology, and structure Specific

  • Only relevant concepts
  • Complete for (part of)

domain

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

slide-5
SLIDE 5

DSLs vs. “modeling”

“modeling”

  • Universal Unified Modeling Language
  • 4GL / CASE systems

Inflexible Adjust development to language / tool Bad reputation DSLs

  • Good tooling: Build new language in 30 min
  • More than generation: Validation,

Simulation, Testing, … Adjust language to

  • Domain
  • Company
  • Project

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

slide-6
SLIDE 6 M P S : E x t e n d Y
  • u
r { L a n g u a g e | I D E }

MPS

slide-7
SLIDE 7

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

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
slide-8
SLIDE 8

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Main advantages: Projectional Editing + Language Composition

User Perspective

Projectional Editing

Developer Perspective

Language Composition

slide-9
SLIDE 9

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Parsing translates between user-facing text and model

Parsing Projection

Parser Serializer

slide-10
SLIDE 10

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Projectional Editing works directly on model

Parsing Projection

Parser Serializer Projection Engine

slide-11
SLIDE 11

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Projectional Editing enables Notational Freedom

Text Embedded Text Form Math Diagram Tree Table Overlay

slide-12
SLIDE 12

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Projectional Editing enables multiple viewpoints on same model

slide-13
SLIDE 13

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

slide-14
SLIDE 14 2 1 9

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Language Composition: Embedding permits two-way interaction between independent languages

SQL C PHP SQL ⊕ C SQL ⊕ PHP C ⊕ SQL

slide-15
SLIDE 15

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Generator: Chains of model-to-model transformations enable flexible composition

«Statemachine» «Java2k» «Java» «Text»

m2m m2m m2t

slide-16
SLIDE 16

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Generator: Chains of model-to-model transformations enable flexible composition

«Statemachine» «Java2k» «Java» «Text»

m2m m2m m2t

«JavaActor»

slide-17
SLIDE 17

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Generator: Implemented through annotated target-language instance

class ExampleClass extends AbstractState { private final Context ctx = ExampleContext .get(); void transition() { } } Input: «Statemachine» Output: «Java»

slide-18
SLIDE 18

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() { } } node.name node.ref(GenCtx) COPY_SRCL(node.transitions)

slide-19
SLIDE 19

Demo

M P S : E x t e n d Y
  • u
r { L a n g u a g e | I D E }
slide-20
SLIDE 20

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Zurich Insurance: Word Pseudo-code to MPS

slide-21
SLIDE 21

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
slide-22
SLIDE 22

MPS: Extend Your { Language | IDE } to Your Domain and System Engineer

Links

DSL

  • Introduction + Links

http://dsl-course.org/

  • Software Language Engineering

Body of Knowledge http://slebok.github.io/ MPS

  • MPS Homepage

https://www.jetbrains.com/mps/

  • MPS Link collection

https://mps.rocks/

  • MPS Community NL

http://mps-community.nl/

slide-23
SLIDE 23

Q & A

M P S : E x t e n d Y
  • u
r { L a n g u a g e | I D E }
slide-24
SLIDE 24 M P S : E x t e n d Y
  • u
r { L a n g u a g e | I D E }