At this year's EclipseCon Europe Tamas Szabo presented a talk about an integration project between MPS (and mbeddr) and the EMF-IncQuery (Eclipse) project. During the summer we had started working on the MPS-IncQuery project which aims to bring IncQuery’s powerful features to the world of the Meta Programming System (MPS). The need for such an integration between the two projects has risen from the context of mbeddr; specifically the graph query engine of IncQuery could come handy for many use-cases in mbeddr.
This includes assessments on requirements documents (the demo was about this use case), computing scoping information in the IDE to figure out what variables/functions are visible at a given point in the C code or to specify constraints. Additionally, projectional editing brings a whole lot of other usages where live maintenance of graphical viewers is important and the response time of the queries is crucial for larger diagrams and models.
The talk was rather technical, due to the complexity of the many involved projects and because we tried to give details on as many of the following challenges as we could:
We also gave a short live demo during the presentation which was centered around the requirements engineering language of mbeddr. This extension is used by many end users of mbeddr to write requirements documents and create various assessments on them. An assessment is simply a query which reports certain program elements and constructs which satisfy given conditions. The following screenshots briefly describe the scenario:
Additionally you can see the query that we have written for the assessment. This establishes a connection between the WorkPackagesAssessmentReport and the WorkPackages. We access the interesting properties (company, priority, scope) of these concepts and use check expressions to specify the conditions when a tuple should appear in the match set of the query.
Finally, here you can see parts of the Java code that is used in the language for the assessment. In MPS you can write constraints and behavior methods (basically derived features) for you language in the Java language of MPS. This language has been extended with additional constructs and types (in runtime) to access the matchers for the queries: Here, we create a matcher for our query and the scope of the query is specified as this.model which will evaluate to the model of the given assessment during “runtime”. Runtime is quite interesting here, because everything happens in the same JVM; query development, code generation and reloading of their classes and using the queries for your own instance model. After this we create a partial match where we set the first parameter to be the assessment and then we retrieve all the values for the second parameter which will be the workpackages found in the model.
Currently we are at the phase of trying out the possibilities with the project; we have already used it in the assessment language of mbeddr (as shown in the demo). The next step would be to reimplement the scoping computation in mbeddr with graph queries of IncQuery and perform some measurements compared to the old solution. Future work will investigate the usability for the graphical editors (this may also have impact on the commercial projects also). The integration project can be obtained from GitHub, while the modified assessment language and the other IncQuery related codes reside in a separate branch of the mbeddr repository.
This integration project faces a dual-licensing situation, where MPS is licensed under Apache 2.0, while all the other tools (EMF-IncQuery, MPS-IncQuery) are licensed under Eclipse EPL. We are planning to provide automatic builds for the project, these will be available through the mbeddr build infrastructure.