SlideShare a Scribd company logo
1 of 125
Challenges in DSL Design
   Sebastian Zarnekow - Sven Efftinge
What do today’s DSL
  projects look like?
Lots of problems are solved
Lots of problems are solved
              textual
         DSL frameworks
Lots of problems are solved
              textual
         DSL frameworks
                             graphical
                          DSL frameworks
Lots of problems are solved
              textual
         DSL frameworks
                              graphical
                           DSL frameworks


                          nice transformation
                               languages
Lots of problems are solved
              textual
         DSL frameworks
                               graphical
                            DSL frameworks


                           nice transformation
                                languages

        open source IDEs
Lots of problems are solved
                       textual
                  DSL frameworks
                                         graphical
                                      DSL frameworks



nice validation                      nice transformation
  languages                               languages

                  open source IDEs
Lots of problems are solved
                       textual
                  DSL frameworks
 nice template                           graphical
   languages                          DSL frameworks



nice validation                      nice transformation
  languages                               languages

                  open source IDEs
Lots of problems are solved
                       textual
                  DSL frameworks
 nice template                           graphical
   languages                          DSL frameworks

              proven infrastructure
nice validation                      nice transformation
  languages                               languages

                  open source IDEs
In most cases
DSLs cover only 80%
... but what’s missing?
Expressions
Why are expressions
     missing?
Hiding
implementation details?
Information hiding in computer science is the
     principle of the hiding of design decisions in a
  computer program that are most likely to change,
   thus protecting other parts of the program from
      change if the design decision is changed. The
protection involves providing a stable interface which
    shields the remainder of the program from the
 implementation (the details that are most likely to
                         change).
 Hiding
 implementation details?
ation of c
Separ           once
                     rns?
atio   n of c
   Se par                         once
                                           rns?
 In computer science, separation of concerns (SoC) is
   the process of breaking a computer program into
distinct features that overlap in functionality as little as
possible. A concern is any piece of interest or focus in a
   program. Typically, concerns are synonymous with
                  features or behaviors.
•   expressions are complicated to
    implement
•   expressions are complicated to
    implement
•   expressions of target platform
    language are already understood
•   expressions are complicated to
    implement
•   expressions of target platform
    language are already understood
•   tooling and libraries can be reused
What’s the price we pay?
Protected Regions
Protected Regions
• generated and manually written code mixed
  up
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
• platform dependent information
Protected Regions
• generated and manually written code mixed
  up
• manual deletion of artifacts
• platform dependent information
• information is dispersed!
Generation Gap Pattern
Generation Gap Pattern
     technically required type hierarchies
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
         platform dependent information
Generation Gap Pattern
     technically required type hierarchies
                    additional complexity
         platform dependent information
            information dispersed!
Black box
target language literals
Black box
target language literals
• bound to target platform
Black box
target language literals
• bound to target platform
 • no option for MDA friends
Black box
target language literals
• bound to target platform
 • no option for MDA friends
• no tooling!
Black box
target language literals
• bound to target platform
 • no option for MDA friends
• no tooling!
• long turnarounds!
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform

     developers know it

          libraries

      very good tooling

           proven

    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform           invent expressions

     developers know it         non-dispersed information

          libraries                   very complex

      very good tooling               very expensive
                                relatively low potential for
           proven
                                    further abstraction
    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform           invent expressions

     developers know it         non-dispersed information

          libraries                   very complex

      very good tooling               very expensive
                                relatively low potential for
           proven
                                    further abstraction
    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform           invent expressions

     developers know it         non-dispersed information

          libraries                   very complex

      very good tooling               very expensive
                                relatively low potential for
           proven
                                    further abstraction
    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform           invent expressions

     developers know it         non-dispersed information

          libraries                   very complex

      very good tooling               very expensive
                                relatively low potential for
           proven
                                    further abstraction
    dispersed information

complexity in code generation

  hard to built interpreters
reuse target platform           invent expressions

     developers know it         non-dispersed information

          libraries                   very complex

      very good tooling               very expensive
                                relatively low potential for
           proven
                                    further abstraction
    dispersed information

complexity in code generation

  hard to built interpreters
Reusing Target Platform
• seems reasonable & pragmatic
• good compromise
But what if ...
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
But what if ...
  reuse target platform             expression as library

      developers know it           non-dispersed information

           libraries              nicer expression language
                                  - closures
       very good tooling
                                  - type inference
            proven                - operator overloading

     dispersed information       extendable (e.g. custom literals)

 complexity in code generation            good tooling

   hard to built interpreters       additional learning curve
What are the
 challenges?
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
concrete syntax         grammar mixing


 abstract syntax        meta model reuse


   constraints     static analysis and validation


 execution time     compiler and interpreter


development time           IDE support
Concrete syntax
Concrete syntax


• scan the document for tokens

• build a parse result from tokens
Concrete syntax


• scan the document for tokens

• build a parse result from tokens
Concrete syntax


• scan the document for tokens       contextless


                                      context-
• build a parse result from tokens     aware
Concrete syntax


• scan the document for tokens       contextless


                                      context-
• build a parse result from tokens     aware
package org.foo;
package org.foo;



Keyword
package
package org.foo;



Keyword   WS
package
package org.foo;



Keyword   WS       ID
package           org
package org.foo;



Keyword   WS       ID    K eyword
package           org        .
package org.foo;



Keyword   WS       ID    K eyword    ID
package           org        .      foo
package org.foo;



                                               o rd
Keyword   WS       ID    K eyword    ID      yw
                                          Ke
package           org        .      foo       ;
package org.foo;



                                               o rd
Keyword   WS       ID    K eyword    ID      yw
                                          Ke
package           org        .      foo       ;




   PackDecl: “package” ID (‘.’ ID)*’;’
What’s reusable?
What’s reusable?

• use rules of other language
What’s reusable?

• use rules of other language
• specialize rules of other language
What’s reusable?

• use rules of other language
• specialize rules of other language
• introduce new rules
Extensible syntax?
   Ambiguity!
Extensible syntax?
   Ambiguity!



   • alternatives may be conflicting
Extensible syntax?
   Ambiguity!



   • alternatives may be conflicting
   • static analysis can help
package org.foo;



                                               o rd
Keyword   WS       ID    K eyword    ID      yw
                                          Ke
package           org        .      foo       ;




   PackDecl: “package” ID (‘.’ ID)*’;’
package org.foo;
          package org.assert;


                                            o rd
Keyword   WS     ID   K eyword    ID      yw
                                       Ke
package         org       .      foo       ;




   PackDecl: “package” ID (‘.’ ID)*’;’
package org.foo;
          package org.assert;


                                          o rd
Keyword   WS     ID   K eyword          yw
                                     Ke
package         org       .              ;




   PackDecl: “package” ID (‘.’ ID)*’;’
package org.foo;
          package org.assert;


                                          o rd
Keyword   WS     ID   K eyword Keyword eyw
                                      K
package         org       .    assert    ;




   PackDecl: “package” ID (‘.’ ID)*’;’
What can we do?
What can we do?


• scannerless parsing
What can we do?


• scannerless parsing
• contextual lexing
package org.foo;
          package org.assert;


                                          o rd
Keyword   WS     ID   K eyword Keyword eyw
                                      K
package         org       .    assert    ;




   PackDecl: “package” ID (‘.’ ID)*’;’
package org.foo;
          package org.assert;


                                          o rd
Keyword   WS     ID   K eyword Keyword eyw
                                      K
package         org       .    assert    ;




   PackDecl: “package” ID (‘.’ ID)*’;’
package org.foo;
          package org.assert;


                                          o rd
Keyword   WS     ID   K eyword Keyword eyw
                                  ID! K
package         org       .    assert    ;




   PackDecl: “package” ID (‘.’ ID)*’;’
Context-aware scanning
   can be confusing
Context-aware scanning
      can be confusing
import “http://namespace/” as
generate import “http://namespace/” as alias




         import “http://namespace/” as generate
         import “http://namespace/” as alias
Context-aware scanning
      can be confusing
   Import:
import “http://namespace/” as lias
generate import ort ‘U RI’ as a
    
 
 
   imp “http://namespace/” as alias




      nerate:
 “http://namespace/” s algenerate
    Ge import                       as ias
                   te name  ‘URI’ a as alias
       import “http://namespace/”
    
 
 
  genera
Context-aware scanning
      can be confusing
import “http://namespace/” as
generate import “http://namespace/” as alias




         import “http://namespace/” as generate
         import “http://namespace/” as alias
Be cautious!

• be careful with new keywords
• minimize set of terminals
• think about extensibility
Abstract syntax
Abstract syntax



       meta models
       are frozen
Linking
Linking


    • inter & intra language
Linking


    • inter & intra language
    • to platform elements
Linking


    • inter & intra language
    • to platform elements
    • reachable elements
Validation
Validation
• inherited
Validation
• inherited
• invariants may not be weakened
Validation
• inherited
• invariants may not be weakened
• contract for compiler and
  interpreter
And then there are...
• compilers
• interpreters
• IDE infrastructure
 • code completion
 • formatting
 • label provider
How can we add and change
implementation non-invasively?
Example:
Customizing the LabelProvider
public class MySpecialLabelProvider
       extends BaseLanguageLabelProvider {

    public String label(Entity e) {
       return e.getName();
    }

    public String label(Feature f) {
       return f.getName()+":"+f.getType().getName();
    }
}

‣naming convention
‣polymorphic dispatch
Available June 24th.
Thank you very much!




www.itemis.com   www.xtext.org
Challenges In Dsl Design

More Related Content

What's hot

So you want to be a programmer
So you want to be a programmerSo you want to be a programmer
So you want to be a programmer
Busayo Oyebisi
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
Dmytro Mindra
 
APARNA_CHAUDHARY_RESUME_2015
APARNA_CHAUDHARY_RESUME_2015APARNA_CHAUDHARY_RESUME_2015
APARNA_CHAUDHARY_RESUME_2015
Aparna Chaudhary
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
rahulsahay19
 

What's hot (20)

Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific Languages
 
Choose flutter
Choose flutterChoose flutter
Choose flutter
 
Advanced IDE functionality in modern language workbenches
Advanced IDE functionality in modern language workbenchesAdvanced IDE functionality in modern language workbenches
Advanced IDE functionality in modern language workbenches
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
Programming Language Selection
Programming Language SelectionProgramming Language Selection
Programming Language Selection
 
C#
C#C#
C#
 
So you want to be a programmer
So you want to be a programmerSo you want to be a programmer
So you want to be a programmer
 
Implementing Refactorings in IntelliJ IDEA
Implementing Refactorings in IntelliJ IDEAImplementing Refactorings in IntelliJ IDEA
Implementing Refactorings in IntelliJ IDEA
 
Concepts of JetBrains MPS
Concepts of JetBrains MPSConcepts of JetBrains MPS
Concepts of JetBrains MPS
 
NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET NetWork - 15.10.2011 - Applied code generation in .NET
NetWork - 15.10.2011 - Applied code generation in .NET
 
The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30The Ring programming language version 1.4 book - Part 2 of 30
The Ring programming language version 1.4 book - Part 2 of 30
 
The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88The Ring programming language version 1.3 book - Part 4 of 88
The Ring programming language version 1.3 book - Part 4 of 88
 
Delphi
DelphiDelphi
Delphi
 
Enlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & ToolkitEnlightenment: A Cross Platform Window Manager & Toolkit
Enlightenment: A Cross Platform Window Manager & Toolkit
 
The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31The Ring programming language version 1.4.1 book - Part 2 of 31
The Ring programming language version 1.4.1 book - Part 2 of 31
 
APARNA_CHAUDHARY_RESUME_2015
APARNA_CHAUDHARY_RESUME_2015APARNA_CHAUDHARY_RESUME_2015
APARNA_CHAUDHARY_RESUME_2015
 
Introduction to SDL Passolo
Introduction to SDL PassoloIntroduction to SDL Passolo
Introduction to SDL Passolo
 
Translating software with SDL Passolo
Translating software with SDL PassoloTranslating software with SDL Passolo
Translating software with SDL Passolo
 
Text to-speech & voice recognition
Text to-speech & voice recognitionText to-speech & voice recognition
Text to-speech & voice recognition
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 

Viewers also liked

Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developers
Sven Efftinge
 

Viewers also liked (15)

2009 LA Film Festival
2009 LA Film Festival2009 LA Film Festival
2009 LA Film Festival
 
Happy New Year!
Happy New Year!Happy New Year!
Happy New Year!
 
Film Independent's 2009 Spirit Awards
Film Independent's 2009 Spirit AwardsFilm Independent's 2009 Spirit Awards
Film Independent's 2009 Spirit Awards
 
Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)Domain Specific Languages (EclipseCon 2012)
Domain Specific Languages (EclipseCon 2012)
 
Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]Getting the most out of Java [Nordic Coding-2010]
Getting the most out of Java [Nordic Coding-2010]
 
Chromosomes
ChromosomesChromosomes
Chromosomes
 
Eclipse Banking Day
Eclipse Banking DayEclipse Banking Day
Eclipse Banking Day
 
Gwt and Xtend
Gwt and XtendGwt and Xtend
Gwt and Xtend
 
Presentation To Cumbria Cim
Presentation To Cumbria CimPresentation To Cumbria Cim
Presentation To Cumbria Cim
 
Xtext Webinar
Xtext WebinarXtext Webinar
Xtext Webinar
 
Xtend - A Language Made for Java Developers
Xtend - A Language Made for Java DevelopersXtend - A Language Made for Java Developers
Xtend - A Language Made for Java Developers
 
Eclipse Xtend
Eclipse XtendEclipse Xtend
Eclipse Xtend
 
Introduction to Xbase
Introduction to XbaseIntroduction to Xbase
Introduction to Xbase
 
Getting rid of backtracking
Getting rid of backtrackingGetting rid of backtracking
Getting rid of backtracking
 
Dependency Injection for Eclipse developers
Dependency Injection for Eclipse developersDependency Injection for Eclipse developers
Dependency Injection for Eclipse developers
 

Similar to Challenges In Dsl Design

Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language Design
Markus Voelter
 
Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
Iván Montes
 
Bdd and dsl как способ построения коммуникации на проекте
Bdd and dsl как способ построения коммуникации на проектеBdd and dsl как способ построения коммуникации на проекте
Bdd and dsl как способ построения коммуникации на проекте
ISsoft
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
umoren
 
Domain Specific Languages
Domain Specific LanguagesDomain Specific Languages
Domain Specific Languages
elliando dias
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
Prageeth Sandakalum
 

Similar to Challenges In Dsl Design (20)

Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
DSL, the absolute weapon for the development
DSL, the absolute weapon for the developmentDSL, the absolute weapon for the development
DSL, the absolute weapon for the development
 
Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language Design
 
Introduction to c_sharp
Introduction to c_sharpIntroduction to c_sharp
Introduction to c_sharp
 
Programming Languages #devcon2013
Programming Languages #devcon2013Programming Languages #devcon2013
Programming Languages #devcon2013
 
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worldsmbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
 
Beyond Sharing: Open Source Design
Beyond Sharing: Open Source DesignBeyond Sharing: Open Source Design
Beyond Sharing: Open Source Design
 
Bdd and dsl как способ построения коммуникации на проекте
Bdd and dsl как способ построения коммуникации на проектеBdd and dsl как способ построения коммуникации на проекте
Bdd and dsl как способ построения коммуникации на проекте
 
BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...
BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...
BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language Workbenches
 
Building DSLs: Marriage of High Essence and Groovy Metaprogramming
Building DSLs: Marriage of High Essence and Groovy MetaprogrammingBuilding DSLs: Marriage of High Essence and Groovy Metaprogramming
Building DSLs: Marriage of High Essence and Groovy Metaprogramming
 
Metamorphic Domain-Specific Languages
Metamorphic Domain-Specific LanguagesMetamorphic Domain-Specific Languages
Metamorphic Domain-Specific Languages
 
Introduction to programming world
Introduction to programming worldIntroduction to programming world
Introduction to programming world
 
Overview new programming languages
Overview new programming languagesOverview new programming languages
Overview new programming languages
 
DSL Best Practices
DSL Best PracticesDSL Best Practices
DSL Best Practices
 
The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)The Spoofax Language Workbench (SPLASH 2010)
The Spoofax Language Workbench (SPLASH 2010)
 
Antlr Conexaojava
Antlr ConexaojavaAntlr Conexaojava
Antlr Conexaojava
 
DSL Construction rith Ruby
DSL Construction rith RubyDSL Construction rith Ruby
DSL Construction rith Ruby
 
Domain Specific Languages
Domain Specific LanguagesDomain Specific Languages
Domain Specific Languages
 
Introduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayambaIntroduction to .NET with C# @ university of wayamba
Introduction to .NET with C# @ university of wayamba
 

More from Sven Efftinge

Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010
Sven Efftinge
 
Xtext @ Profict Summer Camp
Xtext @ Profict Summer CampXtext @ Profict Summer Camp
Xtext @ Profict Summer Camp
Sven Efftinge
 
Vermisste Sprachfeatures in Java (german)
Vermisste Sprachfeatures in Java (german)Vermisste Sprachfeatures in Java (german)
Vermisste Sprachfeatures in Java (german)
Sven Efftinge
 

More from Sven Efftinge (15)

Parsing Expression With Xtext
Parsing Expression With XtextParsing Expression With Xtext
Parsing Expression With Xtext
 
Auto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with XtendAuto-GWT : Better GWT Programming with Xtend
Auto-GWT : Better GWT Programming with Xtend
 
Functional programming with Xtend
Functional programming with XtendFunctional programming with Xtend
Functional programming with Xtend
 
Codegeneration With Xtend
Codegeneration With XtendCodegeneration With Xtend
Codegeneration With Xtend
 
Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012Xtend @ EclipseCon 2012
Xtend @ EclipseCon 2012
 
This Is Not Your Father's Java
This Is Not Your Father's JavaThis Is Not Your Father's Java
This Is Not Your Father's Java
 
Xtext at MDD Day 2010
Xtext at MDD Day 2010Xtext at MDD Day 2010
Xtext at MDD Day 2010
 
Code Generation in Agile Projects
Code Generation in Agile ProjectsCode Generation in Agile Projects
Code Generation in Agile Projects
 
Xtext Eclipse Con
Xtext Eclipse ConXtext Eclipse Con
Xtext Eclipse Con
 
Generic Editor
Generic EditorGeneric Editor
Generic Editor
 
Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)Bessere Softwareentwicklung (Itemis Wintercon)
Bessere Softwareentwicklung (Itemis Wintercon)
 
Domain-Specific Languages in der Praxis
Domain-Specific Languages in der PraxisDomain-Specific Languages in der Praxis
Domain-Specific Languages in der Praxis
 
Xtext @ Profict Summer Camp
Xtext @ Profict Summer CampXtext @ Profict Summer Camp
Xtext @ Profict Summer Camp
 
Vermisste Sprachfeatures in Java (german)
Vermisste Sprachfeatures in Java (german)Vermisste Sprachfeatures in Java (german)
Vermisste Sprachfeatures in Java (german)
 
Scala
ScalaScala
Scala
 

Recently uploaded

Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
instagramfab782445
 
Structuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdfStructuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdf
laloo_007
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
ZurliaSoop
 
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
DUBAI (+971)581248768 BUY ABORTION PILLS IN ABU dhabi...Qatar
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 

Recently uploaded (20)

Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGParadip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Falcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to ProsperityFalcon's Invoice Discounting: Your Path to Prosperity
Falcon's Invoice Discounting: Your Path to Prosperity
 
Putting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptxPutting the SPARK into Virtual Training.pptx
Putting the SPARK into Virtual Training.pptx
 
Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1Katrina Personal Brand Project and portfolio 1
Katrina Personal Brand Project and portfolio 1
 
Buy Verified TransferWise Accounts From Seosmmearth
Buy Verified TransferWise Accounts From SeosmmearthBuy Verified TransferWise Accounts From Seosmmearth
Buy Verified TransferWise Accounts From Seosmmearth
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in OmanMifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
Mifepristone Available in Muscat +918761049707^^ €€ Buy Abortion Pills in Oman
 
Buy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail AccountsBuy gmail accounts.pdf buy Old Gmail Accounts
Buy gmail accounts.pdf buy Old Gmail Accounts
 
Structuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdfStructuring and Writing DRL Mckinsey (1).pdf
Structuring and Writing DRL Mckinsey (1).pdf
 
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdfTVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
TVB_The Vietnam Believer Newsletter_May 6th, 2024_ENVol. 006.pdf
 
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 MonthsSEO Case Study: How I Increased SEO Traffic & Ranking by 50-60%  in 6 Months
SEO Case Study: How I Increased SEO Traffic & Ranking by 50-60% in 6 Months
 
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan CytotecJual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
Jual Obat Aborsi ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan Cytotec
 
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
!~+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUD...
 
Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Falcon Invoice Discounting: Tailored Financial Wings
Falcon Invoice Discounting: Tailored Financial WingsFalcon Invoice Discounting: Tailored Financial Wings
Falcon Invoice Discounting: Tailored Financial Wings
 
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdfDr. Admir Softic_ presentation_Green Club_ENG.pdf
Dr. Admir Softic_ presentation_Green Club_ENG.pdf
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
Uneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration PresentationUneak White's Personal Brand Exploration Presentation
Uneak White's Personal Brand Exploration Presentation
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
Pre Engineered Building Manufacturers Hyderabad.pptx
Pre Engineered  Building Manufacturers Hyderabad.pptxPre Engineered  Building Manufacturers Hyderabad.pptx
Pre Engineered Building Manufacturers Hyderabad.pptx
 

Challenges In Dsl Design

  • 1. Challenges in DSL Design Sebastian Zarnekow - Sven Efftinge
  • 2. What do today’s DSL projects look like?
  • 3. Lots of problems are solved
  • 4. Lots of problems are solved textual DSL frameworks
  • 5. Lots of problems are solved textual DSL frameworks graphical DSL frameworks
  • 6. Lots of problems are solved textual DSL frameworks graphical DSL frameworks nice transformation languages
  • 7. Lots of problems are solved textual DSL frameworks graphical DSL frameworks nice transformation languages open source IDEs
  • 8. Lots of problems are solved textual DSL frameworks graphical DSL frameworks nice validation nice transformation languages languages open source IDEs
  • 9. Lots of problems are solved textual DSL frameworks nice template graphical languages DSL frameworks nice validation nice transformation languages languages open source IDEs
  • 10. Lots of problems are solved textual DSL frameworks nice template graphical languages DSL frameworks proven infrastructure nice validation nice transformation languages languages open source IDEs
  • 11. In most cases DSLs cover only 80%
  • 12. ... but what’s missing?
  • 16. Information hiding in computer science is the principle of the hiding of design decisions in a computer program that are most likely to change, thus protecting other parts of the program from change if the design decision is changed. The protection involves providing a stable interface which shields the remainder of the program from the implementation (the details that are most likely to change). Hiding implementation details?
  • 17. ation of c Separ once rns?
  • 18. atio n of c Se par once rns? In computer science, separation of concerns (SoC) is the process of breaking a computer program into distinct features that overlap in functionality as little as possible. A concern is any piece of interest or focus in a program. Typically, concerns are synonymous with features or behaviors.
  • 19.
  • 20. expressions are complicated to implement
  • 21. expressions are complicated to implement • expressions of target platform language are already understood
  • 22. expressions are complicated to implement • expressions of target platform language are already understood • tooling and libraries can be reused
  • 24.
  • 26. Protected Regions • generated and manually written code mixed up
  • 27. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts
  • 28. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts • platform dependent information
  • 29. Protected Regions • generated and manually written code mixed up • manual deletion of artifacts • platform dependent information • information is dispersed!
  • 31. Generation Gap Pattern technically required type hierarchies
  • 32. Generation Gap Pattern technically required type hierarchies additional complexity
  • 33. Generation Gap Pattern technically required type hierarchies additional complexity platform dependent information
  • 34. Generation Gap Pattern technically required type hierarchies additional complexity platform dependent information information dispersed!
  • 36. Black box target language literals • bound to target platform
  • 37. Black box target language literals • bound to target platform • no option for MDA friends
  • 38. Black box target language literals • bound to target platform • no option for MDA friends • no tooling!
  • 39. Black box target language literals • bound to target platform • no option for MDA friends • no tooling! • long turnarounds!
  • 40.
  • 41. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 42. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 43. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 44. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 45. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 46. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 47. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 48. reuse target platform developers know it libraries very good tooling proven dispersed information complexity in code generation hard to built interpreters
  • 49. reuse target platform invent expressions developers know it non-dispersed information libraries very complex very good tooling very expensive relatively low potential for proven further abstraction dispersed information complexity in code generation hard to built interpreters
  • 50. reuse target platform invent expressions developers know it non-dispersed information libraries very complex very good tooling very expensive relatively low potential for proven further abstraction dispersed information complexity in code generation hard to built interpreters
  • 51. reuse target platform invent expressions developers know it non-dispersed information libraries very complex very good tooling very expensive relatively low potential for proven further abstraction dispersed information complexity in code generation hard to built interpreters
  • 52. reuse target platform invent expressions developers know it non-dispersed information libraries very complex very good tooling very expensive relatively low potential for proven further abstraction dispersed information complexity in code generation hard to built interpreters
  • 53. reuse target platform invent expressions developers know it non-dispersed information libraries very complex very good tooling very expensive relatively low potential for proven further abstraction dispersed information complexity in code generation hard to built interpreters
  • 54. Reusing Target Platform • seems reasonable & pragmatic • good compromise
  • 55. But what if ...
  • 56. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 57. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 58. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 59. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 60. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 61. But what if ... reuse target platform expression as library developers know it non-dispersed information libraries nicer expression language - closures very good tooling - type inference proven - operator overloading dispersed information extendable (e.g. custom literals) complexity in code generation good tooling hard to built interpreters additional learning curve
  • 62. What are the challenges?
  • 63.
  • 64. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 65. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 66. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 67. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 68. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 69. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 70. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 71. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 72. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 73. concrete syntax grammar mixing abstract syntax meta model reuse constraints static analysis and validation execution time compiler and interpreter development time IDE support
  • 75. Concrete syntax • scan the document for tokens • build a parse result from tokens
  • 76. Concrete syntax • scan the document for tokens • build a parse result from tokens
  • 77. Concrete syntax • scan the document for tokens contextless context- • build a parse result from tokens aware
  • 78. Concrete syntax • scan the document for tokens contextless context- • build a parse result from tokens aware
  • 82. package org.foo; Keyword WS ID package org
  • 83. package org.foo; Keyword WS ID K eyword package org .
  • 84. package org.foo; Keyword WS ID K eyword ID package org . foo
  • 85. package org.foo; o rd Keyword WS ID K eyword ID yw Ke package org . foo ;
  • 86. package org.foo; o rd Keyword WS ID K eyword ID yw Ke package org . foo ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 88. What’s reusable? • use rules of other language
  • 89. What’s reusable? • use rules of other language • specialize rules of other language
  • 90. What’s reusable? • use rules of other language • specialize rules of other language • introduce new rules
  • 91. Extensible syntax? Ambiguity!
  • 92. Extensible syntax? Ambiguity! • alternatives may be conflicting
  • 93. Extensible syntax? Ambiguity! • alternatives may be conflicting • static analysis can help
  • 94. package org.foo; o rd Keyword WS ID K eyword ID yw Ke package org . foo ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 95. package org.foo; package org.assert; o rd Keyword WS ID K eyword ID yw Ke package org . foo ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 96. package org.foo; package org.assert; o rd Keyword WS ID K eyword yw Ke package org . ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 97. package org.foo; package org.assert; o rd Keyword WS ID K eyword Keyword eyw K package org . assert ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 98. What can we do?
  • 99. What can we do? • scannerless parsing
  • 100. What can we do? • scannerless parsing • contextual lexing
  • 101. package org.foo; package org.assert; o rd Keyword WS ID K eyword Keyword eyw K package org . assert ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 102. package org.foo; package org.assert; o rd Keyword WS ID K eyword Keyword eyw K package org . assert ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 103. package org.foo; package org.assert; o rd Keyword WS ID K eyword Keyword eyw ID! K package org . assert ; PackDecl: “package” ID (‘.’ ID)*’;’
  • 104. Context-aware scanning can be confusing
  • 105. Context-aware scanning can be confusing import “http://namespace/” as generate import “http://namespace/” as alias import “http://namespace/” as generate import “http://namespace/” as alias
  • 106. Context-aware scanning can be confusing Import: import “http://namespace/” as lias generate import ort ‘U RI’ as a imp “http://namespace/” as alias nerate: “http://namespace/” s algenerate Ge import as ias te name ‘URI’ a as alias import “http://namespace/” genera
  • 107. Context-aware scanning can be confusing import “http://namespace/” as generate import “http://namespace/” as alias import “http://namespace/” as generate import “http://namespace/” as alias
  • 108. Be cautious! • be careful with new keywords • minimize set of terminals • think about extensibility
  • 110. Abstract syntax meta models are frozen
  • 112. Linking • inter & intra language
  • 113. Linking • inter & intra language • to platform elements
  • 114. Linking • inter & intra language • to platform elements • reachable elements
  • 115.
  • 119. Validation • inherited • invariants may not be weakened • contract for compiler and interpreter
  • 120. And then there are... • compilers • interpreters • IDE infrastructure • code completion • formatting • label provider
  • 121. How can we add and change implementation non-invasively?
  • 122. Example: Customizing the LabelProvider public class MySpecialLabelProvider extends BaseLanguageLabelProvider { public String label(Entity e) { return e.getName(); } public String label(Feature f) { return f.getName()+":"+f.getType().getName(); } } ‣naming convention ‣polymorphic dispatch
  • 124. Thank you very much! www.itemis.com www.xtext.org