Comparing Language Workbenches

Language Workbenches

Language Workbenches

For the ‘Program Analysis and Transformation’ seminar I compared three language workbenches, namely Jetbrains Meta Programming System (MPS), Spoofax and Actifsource (Although Actifsoure is not a language workbench but rather model driven development tools).

This post is a short overview over the key strengths and weaknesses of these three tools. The more complete analysis with proper introduction of the tools, explanation of how they work and more detailed comparison can be read in my paper here.

MPS

Strengths

  • Excellent IDE support for the created languages. When you have built your language you already have a good IDE for it. But you can add more, like refactoring’s, code flow analysis etc.
  • You cannot enter code which is not part of your language.
  • It’s easy to navigate through code. Even better, you can look up at anytime how a domain specific language is implemented, even for the MPS languages. This way you can learn from existing languages implementations.
    • It has module support: This allows you to include existing languages into your project. For example you can include the MPS ‘Java’-language. Later on you can include extension to that language, like closures etc. Or extend it yourself.
  • Weaknesses

    • MPS is not text based and your code is not stored in text files. This creates a lot of issues. You cannot use text tools like text-editors, diff-tools, etc. Event worse, you cannot copy and paste code around etc. You need to go through extra steps to talk to external libraries and system.
    • MPS is a standalone tool. It’s not an Eclipse or IntelliJ plug-in. Therefore you cannot use and mix it with other tools.

    Spoofax

    Strengths

    • Everything is text bases, no special files. It uses a classical approach with grammar definition and transformation rules to implement domain specific languages.
    • The same transformation language is used for different purposes, like translating the domain specific language to the target platforms, for code completion, for reference lookups, error detection etc.
    • Spoofax is an Eclipse plug-in. And you can export your domain specific language with the IDE support as Eclipse plug-in.

    Weaknesses

    • For advances IDE features like refactoring you have to fall back to the Eclipse API’s. Spoofax doesn’t have direct support for such things.
    • The IDE support for its own languages is quite disappointing. This also includes the navigation through the code.

    Actifsource

    Note that Actifsoure is not a language workbench, therefore it’s not really comparable to the other two tools.

    Strengths

    • Much easier to learn than the other two tools. Mainly because it only allows UML to model your programs.
    • You can only enter elements which are part of your UML-dialect.
    • It runs on Eclipse, so you can use and combine it with other tools.

    Weaknesses

    • It only supports UML as modeling language.
    • The models are not text based. Again you cannot use you’re text based tools like diff-tools on it.

    More more more…

    Read my paper for a more complete comparison. Christopher Guntli also analyzed two other language workbenches Xtext and EMFText. You can find his paper here. All the publications of the seminar can be found here.

    Update.

    Take a look at the comments for some clarifications about Actifsource and MPS:

    9 thoughts on “Comparing Language Workbenches

    1. Pingback: Comparing Language Workbenches | Gamlor « ???????

    2. Markus Voelter

      A couple of quick comments regarding MPS:
      * you can actually do cut&paste within MPS as within any other tool. Pasting from the “normal” text world is different, however, it works for Java.
      * You are of course right that generic text tools (diff etc) cannot be used, but it is probably fair to say that MPS comes with a diff of its own, as part of the VCS integration.
      * There is a way to plug MPS languages into IntelliJ
      * … and I haven’t given up hope regarding an Eclipse integration in the future 🙂

      Markus

    3. gamlerhart Post author

      Hi Markus

      * Yes, I know that MPS has VCS integration. But I had cases where the MPS diff tool couldn’t show the diff in the MPS editors and just showed me the underlying XML. And I still sometimes would like to use other text tools =).
      * Yes, cut & paste works to some extend. But it’s very clunky. Does copy and paste of Java code work in MPS 1.5? I tried it and I failed to do so.
      * Plug in the language to IntelliJ: How? With MPS 1.5 already? I couldn’t find any way to accomplish that.

      I think some stuff I complained about will be fixed in MPS 2.0, which I didn’t try out.

    4. Pingback: Tweets that mention Comparing Language Workbenches | Gamlor -- Topsy.com

    5. Micha Riser

      Actifsource is not restricted to UML! You can make your own Domain Language. One can argue that you cannot create a full DSL because you cannot define the textual syntax of the language. However, you can define your own types and then create instances of these types. (You cannot do this in UML! In UML you can define stereotypes and then assign stereotypes to your classes. However, you are always create instances of classes!).

      In actifsource there is no need to define a textual syntax for your language because you always work in generic editors, either in the resource editor or graphical domain editor.

    6. gamlerhart Post author

      Thanks for your clarification. Yes, I haven’t evaluated Actifsource as thorough as the other two. Is there a good documentation for doing that?

    7. gamlerhart Post author

      Thanks for the link. What is clear to me is that you can write your meta model and build up your custom language with it. But somehow I’m missing a way to change the ‘visual’ & ‘editor’ representation of that language. You can define your own Sytanx highlighting. But I didn’t find a way to change the ‘presentation’ of the actual model, so that it doesn’t feel like a UML-like language.

    8. Micha Riser

      You are right. To sum up: Yes, you can define your custom language in actifsource but you cannot define the way it is presented (at least in the community edition of actifsource, see below).

      As I have said, the resource editor is generic and you cannot customize it. It automatically adapts to your meta model. (You cannot define the syntax highlighting. The syntax highlight tutorial shows have you define syntax highlight for a the a new *target* language, the destionation language that you generate to.)

      Actifsource has a second way to edit your language: The graphical Domain Diagram Editor. There, you can change the way your actual model is presented, i.e., the shapes and colors and so on. This editor, however, is only available to the users of the enterprise edition of actifsource.