Additional MPS Languages

Hello,

Are you planning to release custom languages built inside of Jetbrains?

Here are some that I've heard of:

  • Swing UI lnaguage
  • Web Applications Language
  • Prolog-like language
  • Diagramming languages
  • Packaging Language
  • SQL support

I didn't find these in MPS Beta 1 distributibe nor in wiki at http://www.jetbrains.net/confluence/display/MPS/MPS+Languages+Repository

At least, it will be really useful to have a single location for all existing/planned languages (open-source, commercial, educational, etc.). It will be kind of marketplace or advertise board both for developers and MPS itself.

Maybe something like IDEA's plugin downloads window.

12 comments
Comment actions Permalink

Hello, Alexander,

Swing UI language is called jetbrains.mps.uiLanguage and can be accessed from modules pool icon at the bottom of the project pane. We have web applications languages but there aren't distributed with MPS and I can't say when they will be distributed outside of JetBrains. We used to have a prolog-like language in distribution but now we don't package it since no one maintains it. We have a diagramming language in a separate repository and it will be downloadable separately from MPS in the future. We have a set of packaging languages. Their namespace starts with jetbrians.mps.build. You can take a look at them in the modules pool. We don't have SQL support yet.

Regards,

Konstantin

0
Comment actions Permalink

+1 to Alexander's request.

I wonder if JetBrains meant for MPS baseLanguage (and "official" extensions) to become the mother of all languages?

in other words, if all custom languages extend the MPS baseLanguage concepts, then all of these languages will be compatible in some way (i.e. generatable to Java without creating custom generators for each language).

For example, Java does not have state machine specific DSL. But let's say we can use the state machine language from MPS (baseLanguage.statemachine?), create models than use that language that, when generated, we get Java source files.

It makes possible also to map other state machine languages to baseLanguage.statemachine, and it will instantly generatable to baseLanguage and therefore Java.

Since baseLanguage is semantically a General Purpose Language, generators can be made for other GPL languages than Java such as Ruby, Groovy, etc. Now all custom languages that generate to baseLanguage can therefore be generated to any output (GPL) language supported by baseLanguage.

To make this scheme to work, the language creators should agree to create (default) generator to baseLanguage, not other output language.

In a way, baseLanguage serves two roles: as an extension to custom languages/DSLs (e.g. adding support for Expressions), and as a target language where any DSLs can then be executed, leveraging the vast (if not mammoth) Java platform and infrastructure.

Is this the intention/vision of JetBrains MPS?

0
Comment actions Permalink

Hello, Hendy,

We don't have the vision which you described. BaseLanguage isn't the mother of all languages. It's just a MPS' counterpart of Java. Actually, we used several other base languages for charisma development: MPS' counterpart of javascript, CSS and XML..

Theoretically, generators can be made to other languages but it's very hard to make such generators efficient.

Regards,

Konstantin

0
Comment actions Permalink

Thanks Konstantin.

You mentioned about JavaScript and CSS, how is this possible?

I meant the model-to-text generation phase, how do I, say, convert from this source model, using an imaginary "metaCSS language" which has a MetaStyleConcept:

style cool

into this output model (in the "simple baseCSS language") in StyleConcept:

.cool {

}

and that StyleConcept happens to have an editor in the CSS text format which looks like the above, i.e. a constant dot, the name, then a pair of braces.

Now I simply want to use the generated model in the baseCSS language verbatim. How can I do this?

0
Comment actions Permalink

Hi!

Statemachine lang as an extension for baseLanguge is here:

http://www.jetbrains.net/confluence/display/MPS/Statemachine+Language

0
Comment actions Permalink

if you are extending 'simple base CSS' with concept like

style cool

then all you have to do is to define (model-to-model) transformation to

.cool {

}

and do not care about text (providing that the base CSS supports text generation for its concepts).

MPS generator is all about model-to-model transformations.

0
Comment actions Permalink

Thanks Igor.

How do I make sure "that base CSS supports text generation for its concepts" ?

i.e. how do i create a language that supports text generation?

0
Comment actions Permalink

The model-to-text generation is specified in 'textGen' aspect in language definition.

Check out the baseLanguage for the instance (you can try Ctrl+Alt+Shift+M  - "go to model" and type 'textGen' - the 1st entry will be 'textGen' model in the baseLanguage).

0
Comment actions Permalink

Thanks Igor. I've found it and it does look a bit complicated, and there's seem to be no mention of it in the docs. Is this an edge use case that MPS is not explicitly designed to do ?

0
Comment actions Permalink

Hi, Hendy

The textGen language is relatively recent addition and there is indeed no documentation on it - i've submitted the issue : http://jetbrains.net/tracker/issue2/MPS-4921

Adding of the text generation aspect to language is not really a thing that we do every day, but nevertheless the text gen (and file gen) is an integral part of the entire concept, wherefore MPS is designed to fully support it.

The alternative you may want to consider is model-to-model transformation from your language to jetbrains.mps.gtext language. The gtext language is essentially a collection of text primitives (i.e. text,line,indent,new-line ect.) and it also supports text/file generation.

Thus, to generate text from your language, instead of adding textgen aspect to your language, you will define generator from your language to gtext language.

Regards, Igor.

0
Comment actions Permalink

Thanks Igor.

Seems like gtext is what I'm looking for. It seems applicable to most cases (80/20) and easier to use than textgen.

BTW the MPS user guide/wiki mentions that model-to-text is only possible using Java language rather than MPS language framework (?), not sure if it's applicable to current state of MPS.

0
Comment actions Permalink

Yes, this information is obsolete. Indeed, in past we had the text gen aspects implemented as collection of java classes.

Now, as you already know, we've got the textGen language and everything has been rewritten in MPS using this language.

0

Please sign in to leave a comment.