Child pages
  • MPS user guide for DSL users
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

One option to distribute DSLs to developers for use is through dedicated IDEs. Language designers wrap a chosen set of languages together with all the required IDE functionality into a newly created custom-tailored standalone application. This application can then be used by developers and language users to edit code. Since all the language design functionality and unrelated languages have been removed, such IDEs offer less clutter, greater focus and better performance in comparison with using full-blown MPS. Administrator consoles, business rule editors or other similar types of applications are examples of the domains that these dedicated IDEs typically aim at.

Before you start

Other user guides

  • User Guide for Language Designers - if you want to learn how to create languages of your own in MPS
  • MPS user guide for Java developers (IntelliJ IDEA) - if you are a Java developer and look for ways to seamlessly combine MPS-based languages with Java
  • Standalone IDE user guide - covers the topic of using MPS-based standalone IDEs

    MPS glossary

    Abstract Syntax Tree (AST)

    a logical representation of code in memory (and disk) in the shape of a tree forest that describes hierarchies of nodes. These nodes have a notion of a parent-child relationship. Additionally, two nodes can be mutually connected with explicit references that go across the hierarchy structure.

    BaseLanguage

    a projectional clone of Java 6 (with optional extensions for Java 7 and 8). It follows the Java specification and is 1:1 compatible with Java 6. Additionally, MPS provides several handy extensions to BaseLanguage, such as dates, collections, closures and many others.

    Code generation

    the process of transfromation code from one model (AST) into another model. For example, code describing a set of business rules can be transformed into plain Java so that it can be compiled with javac and run as part of an enterprise application.
    Code generation in MPS has two phases - first a series of model-to-model transformations gradually reduce the concepts used in the AST of the program until a bottom-line set of base concepts is reached. Then a text-generating phase translates the AST into textual files.

    DevKit

    A package of related languages that have been grouped for user convenience.

    Domain Specific Language (DSL)

    a language dedicated to a particular problem domain, typically created with the aim of simplicity and greater expressivity compared to a general purpose language.

    Language plugin

    a packaged library ( a zip file) containing all the required elements in order to use a language either inside either IntelliJ IDEA or MPS.

    Projectional editor

    an editor that allows the user to edit the AST representation of code directly, while mimicing the behavior of a text editor to some extent. The user sees text on teh screen and edits it, however, in reality the text is only an illusion (projection) of an AST.

    Module

    The top-level organization element of an MPS project that typically groups several models together. It can have three basic types: Solution, Language and DevKit and may depend on other modules and models.

    Model

    A lower-level organizational element grouping individual concepts. It may depend on other models.

    Runtime solution

    A solution that is required by a language, sometimes also called a library. Runtime solutions may contain normal models as well as stubs for Java sources, classes or jar files external to MPS.

    Structure

    A language aspect defining all types (concepts) of AST nodes that can be used in the language together with their relationships.

    Concept

    A definition that describes the abstract structure of a syntax element. E.g. the IfStatement concepts says that an if holds a boolean Expression and up-to two StatementLists.

    Constraints

    A language aspect holding additional restrictions on concepts, their properties and relationships.

    Behavior

    Allows the language designer to define behavior of the language concepts.

    Editor

    Holds vizualization definitions of individual language concepts. Since the way concepts are viewed and edited on the screen can be customized, the editors specify how the user will interact with the language.

    Scope

    The set of elements that are visible and applicable to a particular position within a program. Typically only a sub-set of all elements of a particular kind can be used at any given program location.

    Typesystem

    A set of rules that validate and infer types of concepts in a program. 

    Actions

    User-invoked commands that may perform changes to the code. Actions can be attached to keyboard shortcuts or menu items.

    Intention actions

    Context-sensitive actions offered to the language user through a small pop-up window triggered by the Alt + Enter key shortcut. These actions typically perform a relatively local refactoring to the code under carret or a selected block of code.

    Surround With intention actions

    Intentions applicable to a selected block of code that wrap the block by another concept. E.g. Surround with Try-Catch.

    Refactoring

    A potentially substantial automated change in code structure triggered by a user action.

Frequently Asked Questions (FAQ)

Check out the FAQ document to get some of your questions answered before you even ask them.

Resolving difficulties, understanding reported errors

The Finding your way out of a problem page should give you a hand whenever you run into a problem.

Setting things up

In order to program in MPS-based languages you need to start up MPS or a standalone IDE that was built specificaly for these languages. These dedicated IDEs are essentially cut-down variants of MPS itself, which do not distract a DSL user with unrelated languages and language-design capabilities.

MPS-based IDEs are typically standalone Java applications with their own installation procedure. Please follow the instructions provided by the IDE vendor to properly setup the tool and run it.

Configuration

Just like MPS itself, standalone MPS-based IDEs can be configured and customized using the Settings dialog, which you can invoke through the menu, a toolbar or using a keyboard shortcut (Control + Alt + S / Cmd + ,). Although the actual contents of the dialog may differ among different applications, they typically offer some basic settings for the editor, generator and perhaps VCS. Some may also allow to manage plugins, enable and disable individual languages or integrate third-party tools.

 
Please refer to the documentation of your particular tool for more details on its configuration.

Editor specialities

The clever projectional editor in MPS is slightly different from what you may be used to. Since the editor is the most visible element, which you'll get to know as soon as you start interacting with your code, we prepared a short introductory document - Comanding the editor.

Resolving difficulties, understanding reported errors

The Finding your way out of a problem page should give you a hand whenever you run into a problem.

Where to find language plugins

Languages come packaged as ordinary zip files, which you unzip into the plugin directory or the MPS-based IDE and which the IDE will load upon restart.

VCS integration

Being projectional in the world that has been built on text brings about some challenges. Integration with VCS systems is one of them. In order to be able to standard VCS systems, such as Subversion or Git, MPS provides an add-on that hooks into the important VCS events and gives you a projectional way to merge code and resolve conflicts. With this add-on installed your MPS-based IDE will give you the experience you expect from a VCS for your projectional code.

Check out the details at the Version Control page.

Icon

Did not find the answers? 
Post your questions to our discussion forum 

  • No labels