JetBrains MPS is an environment for defining new languages and language extensions. It allows users to freely define DSLs which are fully integrated. Language designers define a DSL using its schema, editors, and generators. The document discusses MPS features like abstract and concrete syntax, generation, type systems, dataflow analysis, debugging, testing, refactoring, and extensibility. The goal is to initiate discussion on developing advanced IDE functionality for DSLs.
2. Goal
We’ve gone a long way charting the territory
and want to share our part of the map
=> to initiate discussion and ideas
www.jetbrains.com
2
3. Language Workbench
■ Users can freely define new languages which are
fully integrated with each other.
■ The primary source of information is a persistent
abstract representation.
■ Language designers define a DSL in three main
parts: schema, editor(s), and generator(s).
■ Language users manipulate a DSL through a
projectional editor.
■ A language workbench can persist incomplete or
contradictory information in its abstract
representation.
Martin Fowler
www.jetbrains.com
3
4. JetBrains MPS
MPS stands for Meta Programming System
JetBrains MPS is an environment for:
- defining new languages and language extensions
- writing and running/debugging programs in these
languages
www.jetbrains.com
4
5. Agenda
• Abstract and concrete syntax
• Generation
• Type-system
• Dataflow
• Version Control Support
• Debugging
• Testing
• Refactoring
• Extensibility & Modularization
www.jetbrains.com
5
6. Categorization
Parser-based x Projectional
www.jetbrains.com
6
19. Our goal
Use the same language for all generation steps
www.jetbrains.com
19
20. Challenges
Use template language in text generation
Good IDE support in templates
Extensible generators
Fast is good
Incremental generation
In the background - in an outside process
Parallel generator
www.jetbrains.com
20
28. Version Control support
Version control integration should be
implemented for projectional editors
similar to text-based IDE approach
www.jetbrains.com
28
29. Debugger
Useful for development of IDE aspects for DSL
as well as for any other SW development
Application x language debugging
www.jetbrains.com
29
33. Testing
There are two aspects of testing a DSL:
IDE functionality
Code generator
JUnit extensions used in MPS
type-system testing, editor testing, ...
www.jetbrains.com
33
36. Testing Code generator
Execute code generator upon test set of input
models/programs & check there are no errors
Compare generated code with same code
generated before
Compile generated code
Run generated code
www.jetbrains.com
36
37. Challenges
Providing support for testing IDE aspects of
DSLs
No support from MPS side for running
generated code now
Convince the developers to write tests
www.jetbrains.com
37
39. Extensibility
DSLs must be extensible
Use set of languages instead of single huge
DSL
Modular DSL design should simplify DSL
adoption
www.jetbrains.com
39
40. How to develop better DSLs?
One way: Lower the barrier to entry
Integrate with common-place IDEs
www.jetbrains.com
40
Notice how old the definition of structure, editor and generator is\n
A\n
A\n- First give a short look in core/boring aspects of language definition\n- cover advanced IDE functionality \n- show examples from MPS\n- believe all these aspects are important for other LWches, so we will highlight challenges important for particular aspect implementation step-by-step during the presentation\n
V\n
A\n
A\n
A\n
V\n
A\n
V\n
A\n
V\nDemo\n
A\nTextual-based IDEs need these as well\n\n
V\n
A\n
A\n
V\n
A, V\n
A\n
V\n
A\nA declarative DSL\n
V\nStatic analysis of the code in the IDE and during the build process\n
V\n
V\n
V\n
\n
A\n
A\n
\n
A\n
A\n
V\n
V\n
\n
A\n
V\nMartin Fowler identified as one of the “real” DSL problems\n
A\n- Single huge monster-DSL covering all aspects is not our target\n- The point is to make it possible to design set of smaller DSLs working with each other using extensibility provided by Language Workbench\n- Except the fact it’s good way to design DSLs in general, we feel it should simplify adoption of DSLs in software development world\n