Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I use JetBrains MPS in a web application?

I am developing a small web application with Flask. This application needs a DSL, which can express the content of .pdf files.

I have developed a DSL with JetBrains MPS but now I'm not sure how to use it in my web application. Is it possible? Or should I consider to switch to another DSL or make my DSL directly in Python.

like image 240
Rick Grimes Avatar asked Aug 09 '18 09:08

Rick Grimes


People also ask

What is JetBrains MPS used for?

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.

Is MPS open source?

MPS is an open-source product under the Apache 2.0 License.


2 Answers

If you want to use MPS in the web frontend the simple answer is: no.

Since MPS is a projectional editor it needs a projection engine so that user can interact with the program/model. The projection engine of MPS is build in Java for desktop applications. There have been some efforts to put MPS on the web and build Java Script/HTML projection engine but none of the work is complete. So unless you would build something like that there is no way to use MPS in the frontend.

If your DSL is textual anyway and doesn't leverage the projectional nature of MPS I would go down the text DSL road with specialised tooling for that e.g. python as you suggested or Xtext.

like image 83
Kolja Avatar answered Sep 30 '22 03:09

Kolja


I thought I'd make a recommendation if you decide to go down the DSL in python route.
TextX is a good DSL creation library, supports BNF grammars and uses a PEG parser.

like image 35
SerialDev Avatar answered Sep 30 '22 03:09

SerialDev