Advanced IDE functionality in modern language workbenches
Upcoming SlideShare
Loading in...5
×
 

Advanced IDE functionality in modern language workbenches

on

  • 729 views

The presentation of MPS at CodeGeneration 2012

The presentation of MPS at CodeGeneration 2012

Statistics

Views

Total Views
729
Views on SlideShare
729
Embed Views
0

Actions

Likes
0
Downloads
5
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Apple Keynote

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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

Advanced IDE functionality in modern language workbenches Advanced IDE functionality in modern language workbenches Presentation Transcript

  • JetBrains MPSDeveloping advanced IDE functionality for your DSLs Alexander Shatalin Václav Pech JetBrains, Inc. www.jetbrains.com 1
  • 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
  • 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
  • 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
  • Agenda• Abstract and concrete syntax• Generation• Type-system• Dataflow• Version Control Support• Debugging• Testing• Refactoring• Extensibility & Modularization www.jetbrains.com 5
  • 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 cardinality www.jetbrains.com 9
  • Model Validation www.jetbrains.com 10
  • Behavior www.jetbrains.com 11
  • Annotations/AttributesSeamlessly add children to existing conceptsin a generic way www.jetbrains.com 12
  • Annotations/Attributes www.jetbrains.com 13
  • Concrete syntaxEditor www.jetbrains.com 14
  • Actions and IntentionsImprove the user experience in the editor www.jetbrains.com 15
  • GeneratorModel to modeltransformationModel to textgeneration www.jetbrains.com 16
  • Editing target language templatesIDE support requiredThis is model-to-model transformation www.jetbrains.com 17
  • Text generation www.jetbrains.com 18
  • Our goalUse the same language for all generation steps www.jetbrains.com 19
  • 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
  • Type-systemFast and ExtensibleVisible in other aspects (e.g. actions)Type-system is described through a DSL www.jetbrains.com 21
  • Type-system rulesType equality, inequalityReplacement, Sub-typing, Comparison andChecking rules www.jetbrains.com 22
  • 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 27
  • Version Control supportVersion control integration should beimplemented for projectional editorssimilar to text-based IDE approach www.jetbrains.com 28
  • DebuggerUseful for development of IDE aspects for DSLas well as for any other SW developmentApplication x language debugging www.jetbrains.com 29
  • 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 evaluation www.jetbrains.com 32
  • 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
  • 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 generated code with same codegenerated beforeCompile generated codeRun generated code www.jetbrains.com 36
  • ChallengesProviding support for testing IDE aspects ofDSLsNo support from MPS side for runninggenerated code nowConvince the developers to write tests www.jetbrains.com 37
  • RefactoringA well-known problemSolutions: Packaged refactorings (e.g. Eclipse) Preserved refactorings Migration scripts Language versioning www.jetbrains.com 38
  • ExtensibilityDSLs must be extensibleUse set of languages instead of single hugeDSLModular DSL design should simplify DSLadoption www.jetbrains.com 39
  • How to develop better DSLs?One way: Lower the barrier to entry Integrate with common-place IDEs www.jetbrains.com 40
  • SummarySpread the DSL idea far and wide ... www.jetbrains.com 41
  • Q&AThank you! www.jetbrains.com 42