Different DSLs work together and DSL debug?

I have 2 questions:

1. If I create two different DSLs by MPS, how to make them work together?

     Can I extend one language to have the features of the other one? and how?

2. How to debug my DSL in MPS?

     I know MPS can generate Java (or C, C++, etc) code for DSL, but whether this code is correct or executable is unknow. So I have to paste it into another IDE and run or debug it.

     Can I directly debug my DSL in MPS?

Sorry for my English. Hope I described my questions clearly.:-P

3 comments
Comment actions Permalink

Let's start with the second question :-).

As for 1.1, MPS does not have its own debugger, so you can't debug in MPS. You can only run your program (without debugging). If you implement your own language, you'll need to define (at least) a "run configuration" for it in plugin aspect to be able to run program written in it. Run configuration for java applications is included in MPS.

We plan a debugger with base functionality in 1.2, that will be extended in future. Regretfully, I can't say exactly what functionality will be available in 1.2.

0
Comment actions Permalink

> If I create two different DSLs by MPS, how to make them work together?

I'm not sure I understood you right, but if you are asking about using multiple languages in the same MPS model or inside the same root/statement/etc, then the answer is that you just need to add both your languages to "used languages" of your model (ctrl-L), and that's all. After that, you'll be able to use both of them simultaneously.

If you are talking about compatibility of the generated code, it's a task of your language's generator. Mostly, we reduce more complex constructions to simplier ones. So, you only need to reduce to a concept compatible with the place your code is used in (e.g. when reducing expression, it is to be reduced to a child of Expression concept)

> Can I extend one language to have the features of the other one?

> and how?

You can see how it's done in baseLanguage for Statement concept (ctrl-N, type "Statement", select the one from jetbrains.mps.baseLanguage.structure, ctrl-H on concept to see hierarchy). Now you can look at any of those numerous concepts extending Statement in MPS languages.

In two words - to extend language A with A.ext, you need to add A to "extended languages" of A.ext (in language properties), and then inherit some concepts of A.ext from some concepts of A. After that, you can import A.ext into a model using A and use your new concepts at the place where concepts of A can be used.

Regards,

Mihail

0
Comment actions Permalink

Thanks for reply, that helps me a lot!

I found MPS and the idea behind it very interesting and creative, I'm looking forward to MPS 1.2!:-)

I'll be back if I get stuck again.

0

Please sign in to leave a comment.