First Cut at Physical Units

Recently we have implemented the first version of physical units. This is an important aspect in embedded systems and comprises an enhanced type checker plus some tweaks to the code generator (as of now, we only implemented the type checking). The feature consists of two parts. First, we have implemented the seven SI base units as built-in types. We have then created a facility for users to define arbitrary derived units. The following screenshot shows an example.

These types, as well as the SI base units can then be used to annotate types and literals as shown in the next screenshot. We have implemented a restriction that allows only numeric types and the corresponding literals to be annotated with units. Note how the type checker performs unit computations for multiplication and division and reports errors if you try to add “apples and oranges”.

What makes this feature remarkable is this: no change to the C base language was necessary. Everything described above is completely additive and packaged into a separate language module that can be used in programs optionally. Also, the total effort was under two days!

Once again, this brought smiles to Bernd’s and Markus’ faces: MPS really is a terrific tool for language engineering!

An simple Product Engine based on mbeddr

Over the last one and a half days we have built a little demo of DSLs for the insurance domain. It is based on mbeddr and shows nicely how extensible the whole system is. The example is a simple product modeler, including a way to test the calculation formulae directly in the IDE via a table and an interpreter (click on the screenshot to show a bigger version).

The example also shows nicely the benefits of using non-textual notations (tables in this case). We were able to integrate requirements traces and product line variability without any changes — validating the orthogonality of the approach. While we use C’s expression language in the insurance calculations, we exploit MPS’ constraints to limit the set of possible expressions to those that make sense in this domain (i.e. removing some of the C-specific ones such as the address-of operator or the dereferencing operator).

All in all, this was a nice validation of mbeddr’s extensibility and the capabilities of MPS.

Requirements and Variability Support Open Sourced

Today we have open sourced the next set of extensions: the support for requirements, tracability and product line variability. We have packaged all of this into a single distribution file available from our new github download page, and of course you can find the code in the repository. You may want to take a look at the documentation PDF that explains the requirements, traceing and PLE support.

mbeddr @ Embedded World, Part II

The Embedded World 2012 conference is over. As we had mentioned before, mbeddr was shown at the itemis booth as well as in a talk.

There was considerable interest in mbeddr (and the other itemis offerings; not all the people on the photo above were at the booth because of mbeddr :-) ). Bernd did a great job of spending three long days at the conference, convincing people that the “somewhat different” mbeddr approach is worth considering.

The feedback and interest we received is a good basis for mbeddr prototyping over the summer.