MPS or Groovy

I do not know is it good to ask this question here.

I learnt calculator tutorial. When I analyze Groovy and MPS, I notice both have the similar features. Both use Java environment and only difference I noticed MPS has has the projectional editor. Are there any other important thing in MPS than Groovy.

This question is asked only for my knowledge. Appreciated for every little help

8 comments

You probably got confused by the similar language constructs that both MPS and Groovy add to the basic Java syntax. Apart from that these two are very different things - MPS is a complete language workbench, which lets you define your own languages/DSLs, including aspects such as your own type-system rules, dataflow definitions and various structural constrains.

In addition to that, you can use non-parseable notations (diagrams, tables) or define multiple notations and switch between them.

You should perhaps check the Fast Track tutorial to get a quick understanding of the capabilities - https://confluence.jetbrains.com/display/MPSD33/Fast+Track+to+MPS

Vaclac

1

Thank you very much Vaclav Pech. Yes, currently I am following the fast track tutorial. I learn lots from there. I completed up to the calculator language. Then I feel I need to do background research without learning any other DSL. May be I am Crazy. Then I seen the similarities between Groovy and MPS. That's why I did ask the question. Once again thank you very much for your clarification.

I have bit confusion again. Did you mean Groovy will not given the opportunity make our own language? OR it wont give opportunity to define aspects such as own type system, data flow definitions? 

I asked these questions to get clear idea about language what I learn.  

Highly appreciated for your kind help

0

In Groovy you can create, what is called internal DSL, which are special syntactical forms allowed by the flexible Groovy syntax rules. The DSLs still have to be parseable by the Groovy parser. Your DSLs will have the Groovy type-system rules applied to them. In brief, Groovy lets you create DSL very easily, but you cannot divert too far from the Groovy syntax.

With language workbenches you have complete freedom - your languages can be graphical, for example. You can imagine an electrical circuit with embedded pieces of C code attached to individual components of the circuit.

You can actually try the samples bundled with MPS - most of them show DSLs that are beyond what you could achieve with internal DSLs in reasonable time.

Vaclav

 

0

Thank you very much Vaclav Pech. Now I clearly understood. Now I know I am in the correct path. 

Once again thank you very much and highly appreciated for your kind help.

 

0

I am sorry. One last question.

Are there any method to see the AST in a developed language? For an example, I finished calculator language. Are there any method to see AST in MPS? I ask this question, because I seen one time bottom of the screen the node structure. I don't know how to get it back

 

0

For the node under the current cursor you can open the node explorer with alt+f12. You can use the following menu entry to get back to the node explorer:

Alternatively, you may want to use the logical view, which supports to show the node structure:

0

Thank you very much Benjamin Behringer. I got the point.

Highly appreciated.

0

Has any one got AST for the calculator. I just need to study. 

0

Please sign in to leave a comment.