From Programming to Modeling And Back Again

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

7 comments

Comments 1 - 7 of 7 previous next Post a comment

  • + JohanDenHaan Johan den Haan 2 weeks ago
    Excellent presentation. I like both the content and the visuals!
  • + ctranoris Christos Tranoris 2 weeks ago
    Heh, it seems somewhere I missed that from the documentation
  • + schogglad Markus Voelter 2 weeks ago
    they have been, forever.
  • + ctranoris Christos Tranoris 2 weeks ago
    Thank you very much for sharing this! When XText Constraints are going to be available?
  • + schogglad Markus Voelter 2 weeks ago
    thanks guys :-)
  • + ioan.salau Ioan Salau 2 weeks ago
    Excellent presentation, this is the right way to use MDSD. As usual, great job Markus!
  • + peterfriese Peter Friese 2 weeks ago
    Awesome preso, both contentwise and visually!
Post a comment
Embed Video
Edit your comment Cancel

11 Favorites & 1 Group

From Programming to Modeling And Back Again - Presentation Transcript

  1. Programming
    from
    to
    Modeling
    …and back again
    Markus Voelter
    Independent/itemis
    voelter@acm.org
  2. A Journey…
  3. „Houston,
    we have a
    Problem!“
  4. Programming
    Languages
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  5. Programming
    Languages
    are not
    expressive
    enough.
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  6. Programming
    Languages
    are not
    high-level
    enough.
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  7. Programming
    Languages
    are not
    abstract
    enough.
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  8. Programming
    Languages
    are not
    domain-specific
    enough.
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  9. Programming
    Languages
    are not
    enough.
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    C
  10. Programming
    Languages
    Formats
    Erlang
    C#
    C++
    Python
    Java
    Ruby
    Groovy
    Fortran
    json
    C
    HTML
    CSS
    yaml
    XML
  11. Programming
    Languages
    Formats
    Frameworks
    Erlang
    C#
    C++
    Python
    Java
    Django
    Ruby
    Groovy
    WPF
    Fortran
    json
    C
    JEE
    JMS
    HTML
    CSS
    Rails
    yaml
    XML
    lift
  12. Programming
    Languages
    Formats
    Frameworks
    enough.
    are not
    Erlang
    C#
    C++
    Python
    Java
    Django
    Ruby
    Groovy
    WPF
    Fortran
    json
    C
    JEE
    JMS
    HTML
    CSS
    Rails
    yaml
    XML
    lift
  13. not enough?
    for what?
  14. not enough?
    for what?
  15. not enough?
    for what?
  16. So?
  17. Modeling
    … Higher Level
    … Domain Specific
    Concepts & Notations
    … Code Generation
    Interpretation
  18. Modeling
    … Higher Level
    … Domain Specific
    Concepts & Notations
    … Code Generation
    Interpretation
    Solvesthe
    Problem!
  19. But:
  20. Different Worlds
    Programming Tools
    !=
    Modeling Tools
  21. Different Worlds
    Modeling Tool
    !=
    Modeling Tool
  22. Different Worlds
    Mix Models and Programs
  23. Different Worlds
    Mix Models and Programs
    AST Navigation & Query
  24. Different Worlds
    Mix Models and Programs
    AST Navigation & Query
    Integration of 3GL code
  25. Different Worlds
    Mix Models and Programs
    AST Navigation & Query
    Integration of 3GL code
    Code Constraints
  26. pare
    Com
  27. pare
    Com
  28. Domain Specific
    Notations
    and
    Abstractions
    Flexible!
    Limited!
    Frameworks
    Libraries
    (Fluent) APIs
  29. Graphical
    Textual
    Forms
    Tables
    Limited!
    Flexible!
    Textual
    Trees
  30. Customize
    Generator
    or
    Interpreter
    Limited!
    Flexible!
    Reflection
    Meta Programs
    Open Compilers
  31. Define custom
    Query
    or
    Navigate
    or
    Transform
    Limited!
    Flexible!
    AST APIs
    Static Analysis
    Regex
  32. Custom
    Validation
    or
    Error Checks
    Limited!
    Flexible!
    IDE plugins
    Static Analysis
    Open Compilers
  33. Different
    Representations
    and
    Projections
    Limited!
    Flexible!
    Text is Text
    Code Folding
    Tree Views
    Visualizations
  34. Mixing
    and
    Composing
    Languages
    Limited!
    Flexible?
    Python-to-C-like
    Internal DSLs
    Embed-As-String
    Specific: LINQ
  35. Scalable
    Usable
    IDE Support
    Mature!
    Brittle!
    Modeling Tools…!?
  36. Debugging
    Refactoring
    Testing
    Mature!
    Brittle!
    ?
  37. Versioning
    Diff, Merge
    Branching
    Mature!
    Brittle!
    for some tools…
  38. Gets the
    Gets some
    Job Done!
    Jobs done.
    some people doubt that…
    everybody agrees…
  39. Why
    the difference?
  40. History?
  41. Modeling
    Programming
  42. Modeling
    Programming
    … (Mostly) Textual Notations
    … Concrete Syntax Storage
    … (Fancy) ASCII Editors
    … Read-Only Visualizations
  43. Modeling
    Programming
    … (Mostly) Graphical Notations
    … Abstract Syntax Storage
    … Projecting Editors
    … Different editable views for model
    … (Mostly) Textual Notations
    … Concrete Syntax Storage
    … (Fancy) ASCII Editors
    … Read-Only Visualizations
  44. Why
    the difference?
  45. It is time for …
  46. … a Different Perspective
  47. Programming
    the waywe do
    Modeling?
    Modeling
    the waywe do
    Programming?
  48. Modeling
    Programming
    ==
    ==
    Programming
    Modeling
  49. We don‘t want to
    model,
    we want to
    program!
  50. We don‘t want to
    model,
    we want to
    program!
    … at different levels of abstaction
    … from different viewpoints
    … integrated!
  51. We don‘t want to
    model,
    we want to
    program!
    … with different degrees of
    domain-specificity
    … with suitable notations
    … with suitable expressiveness
  52. We don‘t want to
    model,
    we want to
    program!
    And always:
    precise and tool processable
  53. Where do we go from here?
  54. A vision for

    programming
  55. A vision for

    programming
    Enabling

    Technologies
  56. A vision for

    programming
    Enabling

    Technologies
    Available

    Tooling

  57. A vision for
    Programming

  58. Programming
    Languages
    are not
    MODULAR
    enough.
  59. Programming
    Languages
    are not
    COMPOSABLE
    enough.
  60. Programming
    Languages
    are not
    CONFIGURABLE
    enough.
  61. Programming
    Languages
    are not
    ADAPTABLE
    enough.
  62. Programming
    Language Syntax
    is not
    FLEXIBLE
    enough.
  63. Big Language?
    withmany first class concepts!
  64. Small Language?
    with a few, orthogonal
    and poweful concepts
  65. a
    b
    c
    d
    e
    f
    g
    h
    i
    j
    k
    l
    Modular Language
    with many optional,
    composable concepts
  66. Modular Language
    Likeframeworksandlibraries,
  67. Modular Language
    Likeframeworksandlibraries,
    but withsyntaxand IDE support
  68. Not a new idea…
  69. Growing A Language
    (Guy L Steele)
  70. Language
    Workbench
    (Martin Fowler)
  71. Language
    Workbench
    (Martin Fowler)
    Freely
    define
    languages and
    integrate
    them
  72. Language
    Workbench
    (Martin Fowler)
    use
    ?
    persistent
    abstract
    representation
  73. Language
    Workbench
    (Martin Fowler)
    language ::=
    schema
    editors
    +
    generators
    +
  74. Language
    Workbench
    (Martin Fowler)
    ?
    projectional
    editing
  75. Language
    Workbench
    (Martin Fowler)
    persist
    incomplete
    or
    contradictory
    information
  76. Language
    Workbench
    (Martin Fowler)
    powerful
    +
    editing
    testing
    refactoring
    debugging
    groupware
    language definition
    implies
    IDE definition
  77. Language
    Workbench
    (Martin Fowler)
    +
    support for
    „classical“
    programming
    and
    „classical“
    modeling
  78. Syntax
    primarily
    textual
  79. Syntax
    primarily
    textual
    withmoresymbols
    think: mathematics
  80. Syntax
    primarily
    textual
    sometimes
    box&line style
  81. Syntax
    primarily
    textual
    sophisticated
    visualizations
  82. Viewpoints
  83. Viewpoints
    suitable
    abstractions
    and
    notations
    foreach
  84. Viewpoints
    Integrated
    via
    symbolic
    references
    and
    seamless
    transitions
  85. Viewpoints
    Business
    custom
    purpose-built
    create/include
  86. Viewpoints
    Business
    Custom
    Notations
    real
    business
    expert integration
  87. Viewpoints
    Business
    Custom
    Notations
    real
    business
    expert integration
    But that‘s another talk…
  88. Viewpoints
    Technical
    predefined
    library
    configure
  89. Example Languages
  90. (Seemingly)
    Simple Example
    Adding
    matrices
    to C in an
    embedded
    environment.
  91. Currently:
  92. Currently:
    Matrices
    not supported
    in XML format
    and generator
  93. Currently:
    Tool team
    would have to
    do the extension
    … a lot of work
    … busy
    … one central tool
  94. Currently:
    No real
    compiler support
    in the resulting C code
    … type checks
    … operator overloading
    … generics (matrix<int>)
    … matrix syntax?
  95. Better Solution
  96. Better Solution
    generic
    matrix
    and
    vector
    types
  97. Better Solution
    real
    matrix
    and
    vector
    literals
  98. Better Solution
    syntax
    highlights
    for
    vectors
    and
    matrices
  99. Better Solution
    operator
    overloading
  100. Better Solution
    operator
    overloading
    static
    optimization
    … symmetrical matrices
    … identity matrix
    … diagonal matrices
  101. Better Solution
    math
    notation
  102. Better Solution
    a
    separate
    language
    module
    used only by
    those who
    really need it
  103. In addition: PLE Variability
    annotating
    variability
    expressions
    to
    arbitrary
    regions
  104. In addition: PLE Variability
    annotating
    variability
    expressions
    to
    arbitrary
    regions
    statically
    checked
  105. In addition: PLE Variability
    annotating
    variability
    expressions
    to
    arbitrary
    regions
    project
    variant
  106. more later…
    (tool examples)

  107. Enabling
    Technologies


  108. Enabling
    Technologies

    Advanced
    Parser
    Generators
  109. Modeling as Programmig
    … (Mostly) Textual Notations
    … Concrete Syntax Storage
    … (Fancy) ASCII Editors
    … Read-Only Visualizations
  110. Custom
    Syntax
    Graphical
    Textual
    Symbolic++
  111. IDE
    Support
    Teamwork
    Debugging
    Custom Editors
  112. Complete
    Symbolic
    Integration
    Goto Def
    Find Refs
    Refactoring
  113. Xtext-like Tools
    provide editor support
    Custom Editors
    Teamwork
    Goto Def
    Find Refs
    Refactoring
  114. Limited to
    Unicode
    how to handle
    non-character symbols
  115. Graphics !=
    Text
    two worlds…
    separate editors
    … per syntax/viewpoint
    … models can still be ref integrated
  116. What if!
    combine languages
    same seq<Char> as
    different tokens?
  117. Ambiguous!
    Not Parsable.
    Bad Luck.
  118. Traditionally:
    Language ::=
    Token* | Rule*;
  119. Traditionally:
    Language ::=
    Token* | Rule*;
    Token ::=
    Character*;
  120. Traditionally:
    Language ::=
    Token* | Rule*;
    Token ::=
    Character*;
    Rule ::=
    Token* | Rule;
  121. Traditionally:
    Language ::=
    Token* | Rule*;
    2 Phases:
    1. Global Tokenization
    (aka Scanning)
    2. Grammar Recognition
    (aka Parsing)
  122. Modern:
    Language ::=
    Rule*;
    Rule ::=
    Char* | Rule*;
    1 Phase:
    Grammar Recognition
    directly on char*
  123. Scannerless
    Parsing
    No Ambiguity
    when combining languages
    Always Parsable.
    (well, almost. There are some corner cases…)

  124. Enabling
    Technologies

    Projectional
    Editing
  125. text
    … to tree
    … to text
    Parser-based
  126. Projectional
    tree
    … to text-lookalike (editor)
    … to other trees … [*]
    … to text
  127. Programming as Modeling
    … (Mostly) Graphical Notations
    … Abstract Syntax Storage
    … Projecting Editors
    … Different editable views for model
  128. Programming as Modeling
    … (Mostly) Graphical Any kind of Notations
    … Abstract Syntax Storage
    … Projecting Editors
    … Different editable views for model
  129. Language
    Composition
    There‘sno parsing.
    Unique Language Element Identity.
    Unlimted language composition.
  130. Flexible
    Notations
    Textual
    like ASCII
    treated the same
    }
    Graphical
    can be mixed
    box & line
    Semi-Graphical
    mathematical
  131. Automatic
    IDE Extension
    tool support is inherent
    for languages build with
    projectional tools
    language definition
    implies
    IDE definition
  132. Multiple
    Notations
    … for the same concepts
    e.g. in different contexts
    or for different tasks
  133. Partial
    Projections
    … different views
    … for different roles/people
    … only a particular variant
  134. Storage
    != Schema
    … store arbitraty meta data
    change log
    conflicting information
    variability annotations
    … independent of language schema!
    … „aspects“, overlay
  135. Live
    Programs
    think: spreadsheet
    a change to one part of program
    can lead to (dependent) changes
    in other parts
  136. Tree Editing
    … is different from editing text
    … try to make it feel like text
    … takes some gettingused to
    but: for more flexible notations a more general editing paradigm is needed
  137. Infrastructure
    Integration
    … storage is not text
    … diff/merge must be in tool
    … existing text tools don‘t work
  138. Proprietary
    Tools
    … no standards
    … no interop

  139. Available
    Tooling


  140. Available
    Tooling

    Eclipse
    Xtext
  141. http://eclipse.org/modeling
  142. http://eclipse.org/xtext
  143. Eclipse Xtext
    Building Textual Editors
  144. Eclipse Xtext
    Building Textual Editors
  145. Xtext: Specify Grammar
  146. Xtext: Gen. Meta Model
  147. Xtext: Constraints
  148. Xtext: Generated Editor
  149. Xtext: Generated Editor
    Code Completion
  150. Xtext: Generated Editor
    Syntax Coloring
    Custom KeywordColoring
  151. Xtext: Generated Editor
    RealtimeConstraintValidation
  152. Xtext: Generated Editor
    Customizable
    Outlines
  153. Xtext: Generated Editor
    Code Folding
  154. Xtext: Generated Editor
    Goto Definition
    Find References
    Cross-File References
    Model as EMF
  155. Xtext: Generated Editor
  156. PlatformArchitecture
    DSL
  157. As you understand
    anddevelopyour
    PlatformArchitecture…
  158. Develop a language to express it!
  159. Language resembles architectural concepts…
  160. Express the applications with the language.
  161. Another Story…
    Architecture As Language
  162. DEMO I
    Building DSLs with Eclipse Xtext

  163. Available
    Tooling


  164. Available
    Tooling

    Jetbrains‘
    Meta
    Programming
    System
  165. also do…
    IntelliJ IDEA
    Resharper
  166. released in
    Q3 2009
    currently
    1.1 RC1
  167. licensed under
    Apache 2.0
  168. Build new standalone DSLs
  169. Build new standalone DSLs
    Build DSLs that reuse parts
    of other languages
  170. Build new standalone DSLs
    Build DSLs that reuse parts
    of other languages
    Java++
    (MPS comes with BaseLanguage)
    extend base language
  171. Build new standalone DSLs
    Build DSLs that reuse parts
    of other languages
    Java++
    (MPS comes with BaseLanguage)
    extend base language
    build DSLs that reuse parts
    of BaseLanguage
  172. Language Extension Example
    Java + Extension
  173. Language Extension Example
    Old
    Java
    Java + Extension
    ReadWriteLock l = …
    l.readLock().lock();
    try {
    //code
    } finally {
    l.readLock().unlock();
    }
  174. Language Extension Example
    Old
    New
    Java
    Java + Extension
    ReadWriteLock l = …
    l.readLock().lock();
    try {
    //code
    } finally {
    l.readLock().unlock();
    }
    ReadWriteLock l = …
    lock (l) {
    //code
    }
  175. Structure  Editor  Typesystem  Generator
  176. Structure  Editor  Typesystem  Generator
  177. Structure  Editor  Typesystem  Generator
  178. Structure  Editor  Typesystem  Generator
  179. Structure  Editor  Typesystem  Generator
  180. Structure  Editor  Typesystem  Generator
  181. Structure  Editor  Typesystem  Generator
  182. Structure  Editor  Typesystem  Generator
  183. Structure  Editor  Typesystem  Generator
  184. Language Extension Example
    Result behaves like a native
    base language construct
  185. Language Extension Example
    Result behaves like a native
    base language construct
  186. Language Extension Example
    Translated to regular Java code
    based on the generator
    package jaxdemo.sandbox.sandbox;
    import java.util.concurrent.locks.Lock;
    public class DemoClass {
    private Lock lock;
    public DemoClass() {
    try {
    this.getLock().lock();
    SharedResouce.instance().doSomething();
    } finally {
    this.getLock().unlock();
    }
    }
    private Lock getLock() { return this.lock; }
    }
  187. Example Languages
    UI Language
  188. Example Languages
    HTML Templates
  189. Example Languages
    Persistent Classes
  190. DEMO I
    Building DSLs with JetBrains MPS

  191. Available
    Tooling


  192. Available
    Tooling

    Intentional Software
    Domain
    Workbench
  193. Version 1.0 released in
    Dec 15, 2008
    currently at 1.4
  194. Commercial
    Product
  195. Eval available
    upon request
  196. Statemachine Example
    Native Projection
  197. Statemachine Example
    Tabular Projection
  198. Statemachine Example
    Textual DSL Projection
  199. Statemachine Example
    Java Projection
  200. Statemachine Example
    Ruby Projection
  201. Statemachine Example
    Two projections side/side
  202. Statemachine Example
    Two projections side/side
  203. Pension Workbench Example
    Text Editing Domain
  204. Pension Workbench Example
    Insurance Mathematics Domain
  205. Pension Workbench Example
    Pension Contract Rules Domain
  206. Pension Workbench Example
    All in one Document
  207. Pension Workbench Example
    Symbolically integrated
  208. A Journey…
    Arewethere?
  209. A Journey…
    .coordinates
    web email skypexinglinkedin
    www.voelter.devoelter@acm.orgschogglad
    http://www.xing.com/profile/Markus_Voelter
    http://www.linkedin.com/pub/0/377/a31

+ Markus VoelterMarkus Voelter, 3 weeks ago

custom

791 views, 11 favs, 1 embeds more stats

Is programming = modeling? Are there differences, c more

More info about this document

© All Rights Reserved

Go to text version

  • Total Views 791
    • 789 on SlideShare
    • 2 from embeds
  • Comments 7
  • Favorites 11
  • Downloads 45
Most viewed embeds
  • 2 views on http://jmenke.blogspot.com

more

All embeds
  • 2 views on http://jmenke.blogspot.com

less

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel
File a copyright complaint
Having problems? Go to our helpdesk?

Categories

Groups / Events