Powerful Notation to Match Business User Requirements

MPS, short for Meta Programming System is an innovative DSL development tool developed by JetBrains, the creator of the popular IntelliJ IDE. In contract with most other tools, the notation is not restricted to text (like Xtext and others), or graphics (like e.g. Graphiti), but allows users to use a mixture of different notations. Notations currently available are textual, mathematical, tabular, columnar, and graphical (currently in beta) and any mixture of these. In addition you can also use Swing components, like e.g. check boxes or buttons as notation.

This flexibility in notations allows us to adapt the notation in the editor to the notation that business users are familiar with, instead of the other (wrong!) way around. Therefore users will much more easily be able to use the editor and accept such a language.

Projectional Editing

With the abundance of available notations MPS clearly cannot use parsing to achieve this, and it doesn't. The technique that MPS uses is called projectional editing. This style of editing completely derives the layout and notation showed in the editor from the (abstract syntax tree of the) model. Other names used in the past for this kind of editors are structured editor, or syntax directed editor. This kind of editor has a number of advantages over e.g. textual editors:

  • The notation used in the editor is completely derived from the abstract model. This means that you can always change the notation without having to migrate any model. Evolution of the notation is therefore completely effortless.
  • For the same reason, it is easy to define different notations for different users groups. As MPS also allows hiding certain model elements, different editors can use different notations, showing different aspects of the model.

Traditional Disadvantages of Projectional Editing

For mainly textual languages, like e.g. Java, a disadvantage of projectional editing has traditionally been the fact that you cannot freely type any text you like. You had to e.g. first select to insert an IF statement and then you can fill in the condition and the then and else parts. Many programmers don't like that, they rather just freely type everything. This is especially true for expressions, where you would simply type thungs like "a + b * c - d". In a projectional editor you would first have to select the operator (the '+', '*' or '-', and then fill in the variables ('a', 'b', 'c', 'd'). This is cumbersome. When I was doing research (at the CWI and VU in Amsterdam) 25 years ago, this really was an issue.

MPS has solved this drawback in such a way that you can just type the expression as if it were text, and MPS is smart enough to build the AST in the background. Although it feels like typing, internally you are still working directly on the abstract syntax tree. Try it, if you don't believe it.

Summary

MPS is a very flexible tool and allows us to adapt to the needs of business users. As such it deserves a place on the short list for any business specific language you are thinking of.