SlideShare a Scribd company logo
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.
Challenges In Dsl Design
•   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?
Challenges In Dsl Design
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!
Challenges In Dsl Design
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?
Challenges In Dsl Design
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
Challenges In Dsl Design
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

KEY
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
PDF
Language Engineering With Xtext
PDF
Future of Xtext
PDF
Language Workbenches
PPTX
Fun with DSL
PDF
DSLs: what, why, how
PDF
Zoo of domain-specific languages
PPTX
From Programming to Modeling And Back Again
Pragmatic DSL Design with Xtext, Xbase and Xtend 2
Language Engineering With Xtext
Future of Xtext
Language Workbenches
Fun with DSL
DSLs: what, why, how
Zoo of domain-specific languages
From Programming to Modeling And Back Again

What's hot (20)

PPTX
Architecting Domain-Specific Languages
PPTX
Choose flutter
KEY
Advanced IDE functionality in modern language workbenches
PPT
Introduction to c_sharp
PDF
Programming Language Selection
PPTX
So you want to be a programmer
ODP
Concepts of JetBrains MPS
PDF
NetWork - 15.10.2011 - Applied code generation in .NET
PDF
The Ring programming language version 1.4 book - Part 2 of 30
PDF
The Ring programming language version 1.3 book - Part 4 of 88
PPTX
PDF
Enlightenment: A Cross Platform Window Manager & Toolkit
PDF
The Ring programming language version 1.4.1 book - Part 2 of 31
DOC
APARNA_CHAUDHARY_RESUME_2015
PPTX
Introduction to SDL Passolo
PPTX
Translating software with SDL Passolo
PPSX
Text to-speech & voice recognition
PPTX
Introduction To C#
PPT
Architecting Domain-Specific Languages
Choose flutter
Advanced IDE functionality in modern language workbenches
Introduction to c_sharp
Programming Language Selection
So you want to be a programmer
Concepts of JetBrains MPS
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.3 book - Part 4 of 88
Enlightenment: A Cross Platform Window Manager & Toolkit
The Ring programming language version 1.4.1 book - Part 2 of 31
APARNA_CHAUDHARY_RESUME_2015
Introduction to SDL Passolo
Translating software with SDL Passolo
Text to-speech & voice recognition
Introduction To C#
Ad

Viewers also liked (15)

PDF
2009 LA Film Festival
PDF
Happy New Year!
PDF
Film Independent's 2009 Spirit Awards
KEY
Domain Specific Languages (EclipseCon 2012)
KEY
Getting the most out of Java [Nordic Coding-2010]
PPT
Chromosomes
PDF
Eclipse Banking Day
KEY
Gwt and Xtend
PPS
Presentation To Cumbria Cim
PDF
Xtext Webinar
KEY
Xtend - A Language Made for Java Developers
KEY
Eclipse Xtend
PDF
Introduction to Xbase
PDF
Getting rid of backtracking
PDF
Dependency Injection for Eclipse developers
2009 LA Film Festival
Happy New Year!
Film Independent's 2009 Spirit Awards
Domain Specific Languages (EclipseCon 2012)
Getting the most out of Java [Nordic Coding-2010]
Chromosomes
Eclipse Banking Day
Gwt and Xtend
Presentation To Cumbria Cim
Xtext Webinar
Xtend - A Language Made for Java Developers
Eclipse Xtend
Introduction to Xbase
Getting rid of backtracking
Dependency Injection for Eclipse developers
Ad

Similar to Challenges In Dsl Design (20)

PDF
Build your own Language - Why and How?
PPTX
Introduction-to-Programming-Languages.pptx
PDF
DSL, the absolute weapon for the development
PPTX
Domain Specific Language Design
PPT
Introduction to c_sharp
PDF
Programming Languages #devcon2013
PPTX
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
KEY
Beyond Sharing: Open Source Design
PPTX
BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...
PPTX
Bdd and dsl как способ построения коммуникации на проекте
PDF
Envisioning the Future of Language Workbenches
PDF
Building DSLs: Marriage of High Essence and Groovy Metaprogramming
PDF
Metamorphic Domain-Specific Languages
PPTX
Introduction to programming world
PPTX
Overview new programming languages
PPTX
DSL Best Practices
PDF
The Spoofax Language Workbench (SPLASH 2010)
PPT
Antlr Conexaojava
PDF
DSL Construction rith Ruby
PDF
Domain Specific Languages
Build your own Language - Why and How?
Introduction-to-Programming-Languages.pptx
DSL, the absolute weapon for the development
Domain Specific Language Design
Introduction to c_sharp
Programming Languages #devcon2013
mbeddr meets IncQuer - Combining the Best Features of Two Modeling Worlds
Beyond Sharing: Open Source Design
BDD or DSL как способ построения коммуникации на проекте - опыт комплексного ...
Bdd and dsl как способ построения коммуникации на проекте
Envisioning the Future of Language Workbenches
Building DSLs: Marriage of High Essence and Groovy Metaprogramming
Metamorphic Domain-Specific Languages
Introduction to programming world
Overview new programming languages
DSL Best Practices
The Spoofax Language Workbench (SPLASH 2010)
Antlr Conexaojava
DSL Construction rith Ruby
Domain Specific Languages

More from Sven Efftinge (15)

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

Recently uploaded (20)

PPTX
Probability Distribution, binomial distribution, poisson distribution
PDF
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
PDF
Reconciliation AND MEMORANDUM RECONCILATION
PPTX
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
PDF
COST SHEET- Tender and Quotation unit 2.pdf
PDF
WRN_Investor_Presentation_August 2025.pdf
PPTX
HR Introduction Slide (1).pptx on hr intro
PPTX
5 Stages of group development guide.pptx
PPTX
Lecture (1)-Introduction.pptx business communication
DOCX
Euro SEO Services 1st 3 General Updates.docx
PPTX
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
PDF
Ôn tập tiếng anh trong kinh doanh nâng cao
PDF
Unit 1 Cost Accounting - Cost sheet
PDF
Chapter 5_Foreign Exchange Market in .pdf
PPT
Data mining for business intelligence ch04 sharda
DOCX
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
PDF
IFRS Notes in your pocket for study all the time
PPTX
Principles of Marketing, Industrial, Consumers,
PDF
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
PDF
How to Get Business Funding for Small Business Fast
Probability Distribution, binomial distribution, poisson distribution
kom-180-proposal-for-a-directive-amending-directive-2014-45-eu-and-directive-...
Reconciliation AND MEMORANDUM RECONCILATION
CkgxkgxydkydyldylydlydyldlyddolydyoyyU2.pptx
COST SHEET- Tender and Quotation unit 2.pdf
WRN_Investor_Presentation_August 2025.pdf
HR Introduction Slide (1).pptx on hr intro
5 Stages of group development guide.pptx
Lecture (1)-Introduction.pptx business communication
Euro SEO Services 1st 3 General Updates.docx
AI-assistance in Knowledge Collection and Curation supporting Safe and Sustai...
Ôn tập tiếng anh trong kinh doanh nâng cao
Unit 1 Cost Accounting - Cost sheet
Chapter 5_Foreign Exchange Market in .pdf
Data mining for business intelligence ch04 sharda
unit 2 cost accounting- Tender and Quotation & Reconciliation Statement
IFRS Notes in your pocket for study all the time
Principles of Marketing, Industrial, Consumers,
Elevate Cleaning Efficiency Using Tallfly Hair Remover Roller Factory Expertise
How to Get Business Funding for Small Business Fast

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.
  • 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
  • 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!
  • 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?
  • 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
  • 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