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.
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.
MPS is an open-source product under the Apache 2.0 License.
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.
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.
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