mbeddr meets incquer - combining the best features of two modeling worlds

21
MBEDDR MEETS INCQUERY: COMBINING THE BEST FEATURES OF TWO MODELING WORLDS Budapest University of Technology and Economics Fault Tolerant Systems Research Group István Ráth Tamás Szabó

Upload: istvan-rath

Post on 25-Jun-2015

225 views

Category:

Software


1 download

DESCRIPTION

Our talk at EclipseCon Europe 2014 http://eclipsecon.org/europe2014/session/mbeddr-meets-incquery-combining-best-features-two-modeling-worlds

TRANSCRIPT

Page 1: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

MBEDDR MEETS INCQUERY:COMBINING THE BEST FEATURES

OF TWO MODELING WORLDS

Budapest University of Technology and Economics

Fault Tolerant SystemsResearch Group

István Ráth Tamás Szabó

Page 2: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Overview of the talk Introduction

o INCQUERYo mbeddr and MPS

MPS-INCQUERYo A unique integration between Eclipse and non-Eclipse

modeling worldso Adapting a complex Xtext language to a different DSL

paradigm Demo Lessons learned Conclusion

Page 3: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

EMF-INCQUERY

Page 4: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Model queries Model queries:

“code that retrieves a piece of the model” Queries are at the heart of MDE

o Every model access/read is a (simple) queryo More complex: Views, content providerso Most complex: Model transformations, code

generators, …

Page 5: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

EMF-INCQUERY Overview A model query engine for batch and live queries

http://eclipse.org/incquery

• Expressive graph pattern-based language

• Built on Xtext and Xbase• Focus on reusability:

query libraries, query composition

Language

• Incrementalevaluation based on the Rete algorithm

• Instantaneous response for complex queries over large models

Execution

• Query and Change APIs

• Validation• View maintenance• Maven builder for CI

Features

Available from the Eclipse Marketplace Our mission to Mars: 1.0

Page 6: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Your tool FeaturesAPIs

How INCQUERY works

EMF instance

model

Query specifications

Query results

Query result delta stream

Modelmodifications

Change notifications

On-the-fly validation

Live views

Incremental transformations and

code generation

Derived features with notifications

(Xcore)

Incrementality: cost is proportional

to change size, rather than model size

Page 7: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

An extensible set of integrated languages for embedded software development.

Page 8: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

mbeddr Integrated Languages

o Code C language implementationo Higher-level abstractions for Co Tight integration with formal verifications

Extensible Languageso Extend and compose the existing languages easilyo Without invasive changeso Use only the set of languages that you need

Page 9: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

MPS Meta Programming System (JetBrains) Language workbencho A tool that supports the creation, extension and

composition of GPLs and DSLs + their IDEs Development tools are centered around

languageso Domain specific tools Domain specific languages

“Interactive” / Aided AST building

Page 10: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Parsing Projection

Page 11: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

MPS-INCQUERY

Page 12: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Motivation Computing scoping information for content

assist Constraints: restricting containment, scope,

referencing Live view maintenance to support projectional

editing o Component diagrams in mbeddro Block diagrams in a commercial project

Page 13: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

The Integration Challenge EMF-INCQUERY has a very complex Xtext DSL

o Xbase (embedded in the language)o Custom type system and inferencero Strong reliance on cross references for reusabilityo Lots of non-trivial syntactic and semantic validators

Implementing the INCQUERY language in MPSo Concepts, editors, type system, etc.o Substitute MPS Base Language for Xbase o MPS-style Code generatoro Same syntax and same expressive power

Goal: reuse the INCQUERY runtimeo As much as possible

Page 14: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Overview of the approach

Platform (meta meta)

Languages(meta)

Instance models

Goal 2: Notifications

Goal 3: Type safe API extensions for INCQUERY

features

Goal 4: UI extension for

visualizing query results

(debugging)

Goal 1: Queries evaluated

directly over MPS models (C code)

Page 15: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

DEMO

Real world example Language extensions

o Workpackages (tracking of efforts, required time)o Assessments: small queries on various model

elements (reports)

Requirements engineering and tracing in mbeddr

Page 16: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

LESSONS LEARNED

Page 17: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Xtext MPS

Notation Textual Arbitrary (projectional editing)

File Content Readability

Simple text Workbench is needed (XML)

Version control Usual workflowWorkbench is needed

for effective version control

(Language) Extensibility

One linear customization chain

Non-trivial customization is hard

Easy and flexible(by design)

Everything is customizable

Grammar ambiguity? Possible Not possible (arbitrary composition)

Page 18: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Xtext MPS

DocumentationFundamental concepts are well documented,

advanced features are not

Editor usability Eclipse text editorsGetting used to

projectional editing needs time

IDE functionality Similar; code completion, type checking, etc.

UI extensions (tool)Tightly integrated into

Eclipse Swing

Page 19: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Combining Eclipse technologies with MPS Dual licensing (Apache and EPL) Building / continuous integration

o Build language in MPS for building languages, running tests (ant scripts)

o Executable and editor testso Build artifacts are JARs

Interoperability between Eclipse tools and MPSo Through the generated artifacts (both directions)o Direct MPS code modification is not possible (abstraction gap)

On the end-user sideo MPS EMF exporter is availableo importer is not implemented yet

Page 20: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Progress Obtaining / using MPS-INCQUERY?ohttps://github.com/szabta89/MPS-IncQuery oGlobal library (modules pool) of MPS

Ongoing/Future workoSupport for graphical viewers in MPSoReleases• MPS-INCQUERY will be a fully featured and

maintained port• Will be integrated into mbeddr releases (product

build)

Page 21: mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds

Conclusions to take home

Sweet spots