View
228
Download
1
Category
Tags:
Preview:
DESCRIPTION
Our talk at EclipseCon Europe 2014 http://eclipsecon.org/europe2014/session/mbeddr-meets-incquery-combining-best-features-two-modeling-worlds
Citation preview
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ó
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
EMF-INCQUERY
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, …
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
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
An extensible set of integrated languages for embedded software development.
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
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
Parsing Projection
MPS-INCQUERY
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
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
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)
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
LESSONS LEARNED
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)
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
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
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)
Conclusions to take home
Sweet spots
Recommended