Developing mbeddr A Case Study in Language Engineering with MPS - - PowerPoint PPT Presentation

developing mbeddr
SMART_READER_LITE
LIVE PREVIEW

Developing mbeddr A Case Study in Language Engineering with MPS - - PowerPoint PPT Presentation

Lessons Learned from Developing mbeddr A Case Study in Language Engineering with MPS Markus Vlter voelter@acm.org Bernd Kolb bernd.kolb@itemis.de Tamas Szb tamas.szabo@itemis.com Daniel Ratiu daniel.ratiu@siemens.com Arie van


slide-1
SLIDE 1

Lessons Learned from Developing mbeddr

A Case Study in Language Engineering with MPS

Markus Völter Bernd Kolb Tamas Szábó Daniel Ratiu Arie van Deursen voelter@acm.org bernd.kolb@itemis.de tamas.szabo@itemis.com daniel.ratiu@siemens.com Arie.vanDeursen@tudelft.nl

slide-2
SLIDE 2

MPS

slide-3
SLIDE 3

A Language Workbench –

a tool for defining, composing and using ecosystems of languages.

slide-4
SLIDE 4

Open Source Apache 2.0 http://jetbrains.com/mps

slide-5
SLIDE 5

V 2017.2 is current V 2017.3 released later in 2017

slide-6
SLIDE 6

[Language Workbench]

+ Refactorings, Find Usages, Syntax Coloring, Debugging, Language Evolution and Models Migration, Configuration Management, ...

Comprehensive Support for many aspects of Language Definition.

slide-7
SLIDE 7

users

slide-8
SLIDE 8

Parsing

[Projectional Editing]

slide-9
SLIDE 9

Parsing Projectional Editing

[Projectional Editing]

slide-10
SLIDE 10

Regular Code/Text Mathematical Tables Graphical

Syntactic Flexibility

[Projectional Editing]

slide-11
SLIDE 11

Regular Code/Text Mathematical Tables Graphical

Syntactic Flexibility

[Projectional Editing]

slide-12
SLIDE 12

L2 L1

Separate Files In One File Type System Transformation Constraints Type System Transformation Constraints Syntax IDE

Language Composition

[Projectional Editing]

slide-13
SLIDE 13

L2 L1

Separate Files In One File Type System Transformation Constraints Type System Transformation Constraints Syntax IDE

Language Composition

[Projectional Editing]

50+ extensions to C 10+ extensions to requirements lang.

slide-14
SLIDE 14
slide-15
SLIDE 15
slide-16
SLIDE 16

Origins

„Language Workbenches for Embedded Systems“ Research project publicly funded between 2011 – 2013

Goal: show that it is cost effective to build domain specific languages and tools even for small companies or teams

… by using language workbenches

slide-17
SLIDE 17

An extensible set of integrated languages for embedded software engineering.

slide-18
SLIDE 18
slide-19
SLIDE 19

Components (mbeddr)

slide-20
SLIDE 20

State Machines (mbeddr)

slide-21
SLIDE 21

Testing & State M. (mbeddr)

slide-22
SLIDE 22

Mocks & Units (mbeddr)

slide-23
SLIDE 23

Product Lines (mbeddr)

slide-24
SLIDE 24

Registers (smart meter)

slide-25
SLIDE 25

Interrupts (smart meter)

slide-26
SLIDE 26

Messages (smart meter)

slide-27
SLIDE 27

Size of the System

slide-28
SLIDE 28

Variety of Languages

slide-29
SLIDE 29

Dev Timeline

slide-30
SLIDE 30

Homepage

www.mbeddr.com Open Source, Eclipse Public License

https://github.com/mbeddr/mbeddr.core

slide-31
SLIDE 31
slide-32
SLIDE 32

Research Findings

slide-33
SLIDE 33

RQ1: Modularity

Is it practically feasible to define a modular set of languages

  • f the size of mbeddr?
slide-34
SLIDE 34

Modularity

Language Composition Mechanisms used

slide-35
SLIDE 35

Modularity

OO-style composition for structure and syntax

slide-36
SLIDE 36

Modularity

Fine-grained nesting

slide-37
SLIDE 37

Modularity

Modular semantics/generators

slide-38
SLIDE 38

Modularity Wrap Up

mbeddr’s 34 extensions to C are a clear indication that MPS’ language modularity works. Modularity is useful for language understanding, testing and reuse. In rare cases, modularity is compromised by necessary changes to the base language and unwanted dependencies between independent extensions. Currently there is no way to detect (unwanted) semantic interactions between independent language extensions through analysis of their transformations.

slide-39
SLIDE 39

RQ2: Projection

What is the contribution of projectional editing to the success of mbeddr?

slide-40
SLIDE 40

Projection

Variety of notations used in mbeddr

Regular Code/Text Mathematical Tables Graphical

slide-41
SLIDE 41

Projection Wrap Up

The two main benefits of projectional editing – language modularity and a range of combinable notations – have been used extensively in mbeddr. The anticipated benefits have been observed. The editor can be flexibly extended with new notational styles with acceptable effort, as exemplified by the support for math, tables and diagrams. The ability to use multiple and partial projections must be further improved by integrating with other language aspects, in particular, editor actions and type checks.

slide-42
SLIDE 42

RQ3: Complexity

How effective are MPS’ mechanisms for managing the complexity inherent in language development?

slide-43
SLIDE 43

Complexity Wrap Up

The approach of using a DSL for each language aspect works well based on our experience, even though some aspects are missing and some are not declarative enoughto support meaningful analyses. The support for debugging is spotty: it works well for transformations, but debugging generator macros, behaviors and type system rules is very tedious. The ability to extend MPS’ language definition DSLs with MPS itself is a powerful approach for managing complexity, and we have used it extensively, even though it has some limitations.

slide-44
SLIDE 44

RQ4: Scalability

What are the performance and scalability implications?

slide-45
SLIDE 45

Scalability

Generator Performance

slide-46
SLIDE 46

Scalability Wrap Up

If attention is paid to the size of roots and the distribution

  • f code over multiple models, then systems of

significantsize can be built with MPS. The performance of the type system (as it is evaluated in realtime in the editor) and support for cross-model generation are the two most critical ways of improving MPS performance. During the development of languages we have not run into any problems regarding performance or scalability (of editor, type system or generator definitions).

slide-47
SLIDE 47

RQ5: Process

What are the interactions with the development process?

slide-48
SLIDE 48

Process

Language Testing Support

slide-49
SLIDE 49

Process Wrap Up

Except for the missing test support for model migrations and single-step transformations, language testing works well, and we have achieved good coverage as demonstrated by a stable code base. We have successfully integrated mbeddr’s build, test and packaging with the Teamcity CI server, but the effort to get there was significant, partially as a consequence of the inadequacy of MPS’ build language. Migrating instance models as the underlying languages change incompatibly is feasible with manually scripted migrations and their automatic execution based on implicitly-maintained language version numbers.

slide-50
SLIDE 50

Back to the Present

slide-51
SLIDE 51

Today

Our SoSym paper “ends” in 12.2015 “new” developments

slide-52
SLIDE 52

Beyond mbeddr …

slide-53
SLIDE 53

mbeddr today is 20% bigger than in 12.2015 ESD doubles the size of mbeddr today

All Findings Remain Valid

slide-54
SLIDE 54

Thank you!

www.mbeddr.com Open Source, Eclipse Public License

https://github.com/mbeddr/mbeddr.core