Slide 1

Slide 1 text

JetBrains MPS Create a programming language that the whole company can understand Artem Tikhomirov Software Engineering Conference Russia October 2017, St. Petersburg

Slide 2

Slide 2 text

Domain Specific Languages ● A DSL is a focused, processable language for describing a specific concern when building a system in a specific domain ● The abstractions and notations used are natural/suitable for the stakeholders who specify that particular concern. Markus Voelter

Slide 3

Slide 3 text

Math

Slide 4

Slide 4 text

How come?

Slide 5

Slide 5 text

DSLs? Who cares? You! DSLs are ubiquitous!

Slide 6

Slide 6 text

Buisness Processes

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

● Health and medicine ● Stakeholder integration, Scalable Business, Document Generation + Certification ● Finance ● Precise Specification and Implementation of Insurance Products („Rules“) ● Government ● Changing Regulations, Fast Implementation, End User Empowerment ● Automotive ● Code Complexity, Frameworks (Autosar), Product Lines ● Aerospace ● Reduction of Accidental Complexity in Code, Process Conformance (Docs) ● Robotics ● A powerful language and IDE for existing frameworks (Industry Robots, ROS) ● Embedded software ● Multi-Paradigm Programming, not just Simulink and C ● Science ● Consistent Derived Documents

Slide 9

Slide 9 text

Most widely adopted DSM tool

Slide 10

Slide 10 text

Too narrow view of programming?

Slide 11

Slide 11 text

Demo ● Language to configure voice menu for an answering maching ● Jetbrains MPS as a Rich Client Platform ● Business value is negligible – Market share of your office assistant is small

Slide 12

Slide 12 text

● Health and medicine ● Stakeholder integration, Scalable Business, Document Generation + Certification ● Finance ● Precise Specification and Implementation of Insurance Products („Rules“) ● Government ● Changing Regulations, Fast Implementation, End User Empowerment ● Automotive ● Code Complexity, Frameworks (Autosar), Product Lines ● Aerospace ● Reduction of Accidental Complexity in Code, Process Conformance (Docs) ● Robotics ● A powerful language and IDE for existing frameworks (Industry Robots, ROS) ● Embedded software ● Multi-Paradigm Programming, not just Simulink and C ● Science ● Consistent Derived Documents

Slide 13

Slide 13 text

Healthcare Software Medical Devices Accessible to Doctors Robustness and Correctness Required To be FDA-certified Needs to run on multiple target platforms ● IOS ● Android ● JavaScript

Slide 14

Slide 14 text

Stakeholders driving the development Physicists Product Management System Engineering / R&D Customer Service Supply Chain Management Management (Business Cases) / Platform- & Release-Strategy

Slide 15

Slide 15 text

SW Experts HW/ FW Software package System Engineering Physicists Product Management Customer Service Installed Software

Slide 16

Slide 16 text

HW/ FW SW Experts Software package System Engineering Physicists Product Management Customer Service Installed Software Code generation space DSL DSL DSL DSL

Slide 17

Slide 17 text

Domain Experts SW Experts Scanner Model / SW

Slide 18

Slide 18 text

Domain Experts SW Experts On demand (automatically) Scanner Model / SW

Slide 19

Slide 19 text

No content

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

When to DSL? ● Complex domain knowledge ● Painful translation of expertise from a domain specialist to a programmer – Gap in abstraction level ● Not directly related to programming – biology, math, insurance – Verification, analysis, simulation. ● Classes of applications – Software factories

Slide 22

Slide 22 text

Typical risks ● Language design takes effort – Adds to the cost of the project → need for reuse ● Language design skills – Steep learning curve – What goes into the language – How to make it elegant ● Proper tooling

Slide 23

Slide 23 text

No content

Slide 24

Slide 24 text

MPS is an open-source language workbench for DSL development

Slide 25

Slide 25 text

DSM isn't new

Slide 26

Slide 26 text

DSLs with MPS ● Abstract Syntax ● Concrete Syntax ● M2M, M2T ● Semantics: Typesystem, Dataflow ● IDE integration, UI ● Tooling: build, plugins ● Evolution/migration ● Deployment: custom IDE, RCP

Slide 27

Slide 27 text

DSLs with MPS ● Abstract Syntax ● Concrete Syntax ● M2M, M2T ● Semantics: Typesystem, Dataflow ● IDE integration, UI ● Tooling: build, plugins ● Evolution/migration ● Deployment: custom IDE, RCP

Slide 28

Slide 28 text

Textual editing R A B C D R R A B C D R R A B C D R Text Text Binary edit parse save editing compile parse Compiler

Slide 29

Slide 29 text

Projectional editing R A B C D R R A B C D R R A B C D R Text Binary edit save editing compile parse Compiler R A B C D R generate

Slide 30

Slide 30 text

Projectional editing R A B C D R R A B C D R R A B C D R Binary edit save editing compile Compiler R A B C D R generate

Slide 31

Slide 31 text

Projectional editing

Slide 32

Slide 32 text

by Jens Nerche @jensnerche Rich syntaxes

Slide 33

Slide 33 text

Tabular notations

Slide 34

Slide 34 text

Symbolic notations

Slide 35

Slide 35 text

Positional notations

Slide 36

Slide 36 text

Multiple switchable notations

Slide 37

Slide 37 text

Combine languages

Slide 38

Slide 38 text

No content

Slide 39

Slide 39 text

Parsing is the bottleneck … of language expressiveness – Limits the possible syntaxes – Allows only one editable code visualization – Complicates combining languages

Slide 40

Slide 40 text

DSLs with MPS ● Abstract Syntax ● Concrete Syntax ● M2M, M2T ● Semantics: Typesystem, Dataflow ● IDE integration, UI ● Tooling: build, plugins ● Evolution/migration ● Deployment: custom IDE, RCP

Slide 41

Slide 41 text

Code generation R A B C D R R A B C D R R A B C D R Text Binary edit save editing compile parse Compiler R A B C D R generate

Slide 42

Slide 42 text

Generators Map solutions from a problem domain to an implementation domain ● Transform models ● Output models or text

Slide 43

Slide 43 text

Compiler analogy do { call(); } while R := A MUL B 01101 10101 Source code Intermediate presentation Machine code repeat turnLeft do { call(); } while DSLs do { call(); } while General-purpose language Source code repeat turnLeft do { call(); } while DSLs Source code

Slide 44

Slide 44 text

OMG/MOF Perspective A B C D R A B C D R A B C D R do { call(); } while Model to Model Model to Text repeat turnLeft do { call(); } while DSLs do { call(); } while General-purpose language Source code A B C D R AST == Model

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

jetbrains.com/mps Thank you for your attention __

Slide 47

Slide 47 text

Books ● http://books.campagnelab.org ● http://dslbook.org https://www.jetbrains.com/mps/publications