I have used Eclipse Xtext in several projects. I loved the ease of defining a grammar over an Ecore (meta)model and letting everything generated for you including awesome Eclipse plugin editor, but I was quite uncomfortable with the underlying EMF framework with everything hard-wired in static fields.
Lately I came across Jetbrains' MPS (Meta Programming System). It's based on completely different philosophy. While Xtext is for creating text-based DSLs generating a parser for you (and instantiating those EObjects), in MPS-created language one edits directly underlying model structure. So far I get it.
Has anybody experience with both those DSL tools to point out the main differences in terms of working with them, intended use cases and audience, complexity, learning curve (to be honest, to start using Xtext one should know quite a lot about EMF's guts), code generation etc?
JetBrains MPS (Meta Programming System) is a language workbench developed by JetBrains. MPS is a tool to design domain-specific languages (DSL). It uses projectional editing which allows users to overcome the limits of language parsers, and build DSL editors, such as ones with tables and diagrams.
Xtext is a framework for development of programming languages and domain-specific languages. With Xtext you define your language using a powerful grammar language.
Xtext is a traditional parser-based approach that works with ordinary textual files. Those can be mailed, stored and compared with any version control system and even modified outside the editor using your favorite command line tool. It tightly integrates into Eclipse EMF and works pretty well with a whole bunch of tools you can find in the Eclipse eco-system. Recently, it evolved (and is doing so still) into some kind of "programming language development toolkit" where it allows you to support all kind of additional tooling.
MPS on the other side works with a projection-based editor that just "looks" like text while you are working within the environment. The underlying storage format is tool-specific (read: unusable without special programs) and does not parse plain text files. This offers some great advantages such as embedding of arbitrary langauges (e.g. Regex inside SQL inside Java). The toolchain enables generation in form of model to model transformations that -as the editor- feel unusual at the beginning but are powerful, too.
Both tools are somehow locking you into their world (MPS/Eclipse). Even though you could run both in a headless mode, one cannot easily launch the Xtext editor inside another IDE. The same is true for MPS. I would argue that Xtext is "more open", since it works with ordinary text files on one hand and plays well with established tools (EMF and Eclipse in general) on the other hand.
Does this answer your question? I will try to give you more precise answers if you have more detailed questions.
The main idea of MPS isn't using a projectional editor instead of a text based one. It's the language compasability. For example, you can extend Java with tuples, and another person could extend Java with async method calls. In text based tools (like XText), it's impossible to guarantee that two extensions work well together, since the resulting grammar might be ambiguous. MPS makes this possible. You just add language to your project like you add libraries.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With