Your SlideShare is downloading. ×
0
JetBrains MPSDeveloping advanced IDE functionality           for your DSLs         Alexander Shatalin            Václav Pe...
GoalWe’ve gone a long way charting the territoryand want to share our part of the map  => to initiate discussion and ideas...
Language Workbench■ Users can freely define new languages which are  fully integrated with each other.■ The primary source...
JetBrains MPSMPS stands for Meta Programming SystemJetBrains MPS is an environment for:- defining new languages and langua...
Agenda•   Abstract and concrete syntax•   Generation•   Type-system•   Dataflow•   Version Control Support•   Debugging•  ...
Categorization    Parser-based x Projectional                 www.jetbrains.com                                     6
Abstract syntax              www.jetbrains.com                                  7
Node definition                  www.jetbrains.com                                      8
Structural constraints                                          Type of a property                                   Child...
Model Validation              www.jetbrains.com                                  10
Behavior           www.jetbrains.com                               11
Annotations/AttributesSeamlessly add children to existing conceptsin a generic way                   www.jetbrains.com    ...
Annotations/Attributes              www.jetbrains.com                                  13
Concrete syntaxEditor              www.jetbrains.com                                  14
Actions and IntentionsImprove the user experience in the editor                   www.jetbrains.com                       ...
GeneratorModel to modeltransformationModel to textgeneration                 www.jetbrains.com                            ...
Editing target language templatesIDE support requiredThis is model-to-model transformation                   www.jetbrains...
Text generation                  www.jetbrains.com                                      18
Our goalUse the same language for all generation steps                   www.jetbrains.com                                ...
ChallengesUse template language in text generationGood IDE support in templatesExtensible generatorsFast is good  Incremen...
Type-systemFast and ExtensibleVisible in other aspects (e.g. actions)Type-system is described through a DSL               ...
Type-system rulesType equality, inequalityReplacement, Sub-typing, Comparison andChecking rules                 www.jetbra...
Type-system rules              www.jetbrains.com                                  23
DataflowDead codePotential NPE...                www.jetbrains.com                                    24
Unreachable code             www.jetbrains.com                                 25
Potential NPE                www.jetbrains.com                                    26
Dataflow AnalyzersCustomized dataflow validation                           www.jetbrains.com                              ...
Version Control supportVersion control integration should beimplemented for projectional editorssimilar to text-based IDE ...
DebuggerUseful for development of IDE aspects for DSLas well as for any other SW developmentApplication x language debuggi...
Debugging MPS Type System rule             www.jetbrains.com                                 30
MPS Type System trace             www.jetbrains.com                                 31
ChallengesImprove debugger definition to abstract it fromfinal target languageProvide access to DSL variables in evaluatio...
TestingThere are two aspects of testing a DSL:    IDE functionality    Code generatorJUnit extensions used in MPS  type-sy...
Testing IDE functionality               www.jetbrains.com                                   34
Testing IDE functionality               www.jetbrains.com                                   35
Testing Code generatorExecute code generator upon test set of inputmodels/programs & check there are no errorsCompare gene...
ChallengesProviding support for testing IDE aspects ofDSLsNo support from MPS side for runninggenerated code nowConvince t...
RefactoringA well-known problemSolutions:  Packaged refactorings (e.g. Eclipse)  Preserved refactorings  Migration scripts...
ExtensibilityDSLs must be extensibleUse set of languages instead of single hugeDSLModular DSL design should simplify DSLad...
How to develop better DSLs?One way: Lower the barrier to entry             Integrate with common-place IDEs               ...
SummarySpread the DSL idea far and wide ...                   www.jetbrains.com                                       41
Q&AThank you!             www.jetbrains.com                                 42
Upcoming SlideShare
Loading in...5
×

Advanced IDE functionality in modern language workbenches

620

Published on

The presentation of MPS at CodeGeneration 2012

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
620
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Vaclav, Alex\n
  • \n
  • 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
  • A\nRefer to Markus\n
  • V\nScreen-shot\n
  • V\n
  • \n
  • Transcript of "Advanced IDE functionality in modern language workbenches"

    1. 1. JetBrains MPSDeveloping advanced IDE functionality for your DSLs Alexander Shatalin Václav Pech JetBrains, Inc. www.jetbrains.com 1
    2. 2. GoalWe’ve gone a long way charting the territoryand want to share our part of the map => to initiate discussion and ideas www.jetbrains.com 2
    3. 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. 4. JetBrains MPSMPS stands for Meta Programming SystemJetBrains MPS is an environment for:- defining new languages and language extensions- writing and running/debugging programs in theselanguages www.jetbrains.com 4
    5. 5. Agenda• Abstract and concrete syntax• Generation• Type-system• Dataflow• Version Control Support• Debugging• Testing• Refactoring• Extensibility & Modularization www.jetbrains.com 5
    6. 6. Categorization Parser-based x Projectional www.jetbrains.com 6
    7. 7. Abstract syntax www.jetbrains.com 7
    8. 8. Node definition www.jetbrains.com 8
    9. 9. Structural constraints Type of a property Child cardinality www.jetbrains.com 9
    10. 10. Model Validation www.jetbrains.com 10
    11. 11. Behavior www.jetbrains.com 11
    12. 12. Annotations/AttributesSeamlessly add children to existing conceptsin a generic way www.jetbrains.com 12
    13. 13. Annotations/Attributes www.jetbrains.com 13
    14. 14. Concrete syntaxEditor www.jetbrains.com 14
    15. 15. Actions and IntentionsImprove the user experience in the editor www.jetbrains.com 15
    16. 16. GeneratorModel to modeltransformationModel to textgeneration www.jetbrains.com 16
    17. 17. Editing target language templatesIDE support requiredThis is model-to-model transformation www.jetbrains.com 17
    18. 18. Text generation www.jetbrains.com 18
    19. 19. Our goalUse the same language for all generation steps www.jetbrains.com 19
    20. 20. ChallengesUse template language in text generationGood IDE support in templatesExtensible generatorsFast is good Incremental generation In the background - in an outside process Parallel generator www.jetbrains.com 20
    21. 21. Type-systemFast and ExtensibleVisible in other aspects (e.g. actions)Type-system is described through a DSL www.jetbrains.com 21
    22. 22. Type-system rulesType equality, inequalityReplacement, Sub-typing, Comparison andChecking rules www.jetbrains.com 22
    23. 23. Type-system rules www.jetbrains.com 23
    24. 24. DataflowDead codePotential NPE... www.jetbrains.com 24
    25. 25. Unreachable code www.jetbrains.com 25
    26. 26. Potential NPE www.jetbrains.com 26
    27. 27. Dataflow AnalyzersCustomized dataflow validation www.jetbrains.com 27
    28. 28. Version Control supportVersion control integration should beimplemented for projectional editorssimilar to text-based IDE approach www.jetbrains.com 28
    29. 29. DebuggerUseful for development of IDE aspects for DSLas well as for any other SW developmentApplication x language debugging www.jetbrains.com 29
    30. 30. Debugging MPS Type System rule www.jetbrains.com 30
    31. 31. MPS Type System trace www.jetbrains.com 31
    32. 32. ChallengesImprove debugger definition to abstract it fromfinal target languageProvide access to DSL variables in evaluation www.jetbrains.com 32
    33. 33. TestingThere are two aspects of testing a DSL: IDE functionality Code generatorJUnit extensions used in MPS type-system testing, editor testing, ... www.jetbrains.com 33
    34. 34. Testing IDE functionality www.jetbrains.com 34
    35. 35. Testing IDE functionality www.jetbrains.com 35
    36. 36. Testing Code generatorExecute code generator upon test set of inputmodels/programs & check there are no errorsCompare generated code with same codegenerated beforeCompile generated codeRun generated code www.jetbrains.com 36
    37. 37. ChallengesProviding support for testing IDE aspects ofDSLsNo support from MPS side for runninggenerated code nowConvince the developers to write tests www.jetbrains.com 37
    38. 38. RefactoringA well-known problemSolutions: Packaged refactorings (e.g. Eclipse) Preserved refactorings Migration scripts Language versioning www.jetbrains.com 38
    39. 39. ExtensibilityDSLs must be extensibleUse set of languages instead of single hugeDSLModular DSL design should simplify DSLadoption www.jetbrains.com 39
    40. 40. How to develop better DSLs?One way: Lower the barrier to entry Integrate with common-place IDEs www.jetbrains.com 40
    41. 41. SummarySpread the DSL idea far and wide ... www.jetbrains.com 41
    42. 42. Q&AThank you! www.jetbrains.com 42
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×