on
Implementing LionWeb in Rascal
The LionWeb initiative was started two years ago, to facilitate the interoperability between various language engineering tools and, in this way, to allow for the reuse of language engineering components and modeling tools. Recently I have been working on the implementation of the LionWeb protocol in Rascal. Rascal is a meta-programming language that is used for the implementation of textual DSLs and for more generic use cases of syntax-based analysis and transformation of programming code.
Comparing to the tools already integrated with LionWeb, Rascal belongs to the traditional grammarware space. In Rascal models are represented as abstract syntax trees and new types are defined using algebraic data types. Furthermore, Rascal doesn’t support traditional OO concepts: there are no objects, only immutable values; no user defined sub-typing (i.e. inheritance); all models are pure trees, without explicit cross-referencing between their nodes. To close this expressiveness gap, I used techniques introduced by the work 2017 by Tijs van der Storm on the conversion between Ecore and Rascal.
The current implementation of LionWeb in Rascal allows for importing LionWeb languages (M2) and models (M1) in Rascal. For example, we can now import an Expressions
language created in MPS:
— into Rascal, as a set of algebraic data types (ADT):
And using this imported Expressions
language, we now can import an instance model created in MPS:
— into Rascal, as an abstract syntax tree (AST):
The implementation is available in the GitHub repository: https://github.com/UlyanaTikhonova/lionweb-rascal
About Ulyana Tikhonova
I am a Model Driven Software Engineer at F1RE, since April 2024. I am a big fan of domain-specific languages (DSLs) and model-driven approach. I did my PhD on the semantics of DSLs and had worked with model-based testing on an industrial scale.
You can contact me at ulyana@f1re.io.