Upgrade to Pro — share decks privately, control downloads, hide ads and more …

The Dynamic Language is not Enough

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

The Dynamic Language is not Enough

Most today’s software is highly static, even if it is written in a dynamic language like Smalltalk. Developers are not encouraged to extend the frameworks they are using; and end-users are unable to change the features of their software without initiating a new development effort. In contrast, extensible software is designed for change; and customizable software can be adapted to new needs without requiring an in-depth knowledge of the underlying implementation domain.

In this presentation I will investigate on how to write truly dynamic software and I will distill common patterns of software customizability. As running examples I present tools that I worked on during my path of discovering Smalltalk. One of these examples is Magritte, a dynamic meta-model that gives end-users the possibility to customize their applications without the need of an additional development effort. Another example is Helvetia, an infrastructure enabling on-the-fly customization of the programming language and development environment.

Avatar for Lukas Renggli

Lukas Renggli

October 04, 2011
Tweet

More Decks by Lukas Renggli

Other Decks in Technology

Transcript

  1. :-S Dynamic Language Static Software no support easier can always

    get away with reflection faster don’t know how to do it too complex out-of- the-box
  2. Other Users ‣ Monticello Repository Types ‣ OmniBrowser Commands ‣

    Code Critics Rules ‣ TextLint Rules (later today) ‣ Pier Commands, Views, Structures ‣ Magritte Description Types
  3. menuCommandOn:  aBuilder   <worldMenu>   (aBuilder  item:  'Shout  Workspace')  

      parent:  #Tools;     action:  [  self  open  ]
  4. menuCommandOn:  aBuilder   <worldMenu>   (aBuilder  item:  'Shout  Workspace')  

      parent:  #Tools;     action:  [  self  open  ] PragmaCollector  allSystemPragmas      select:  [  :each  |  each  keyword  =  #worldMenu  ] }
  5. Alternatives to Pragmas ‣ Naming convention for selector names ‣

    Naming convention for protocol names ‣ All methods of a specific class
  6. Other Users ‣ Pier Value Links ‣ Pharo Compiler Primitives,

    System Settings ‣ OmniBrowser Commands, Obsolete Commands, and Browser Meta-Model
  7. Discussion ‣ UI independent ‣ Domain-specific reflection ‣ Extensible using

    subclassing/extending ‣ Can cause meta-confusion ‣ Can be limiting or slow
  8. Other Users ‣ GLORP Relational Object Mapping ‣ Glamour Browser

    Model ‣ Monticello Code Model ‣ Announcement Event Model ‣ Magritte Meta-Model
  9. Address Description street = 'Schützenmattstrasse' plz = 3012 place =

    'Bern' canton = 'Bern' :Address label = 'Street' :StringDescription label = 'PLZ' required = true range = 1000..9999 :NumberDescription label = 'Place' required = true :StringDescription label = 'Canton' required = true sorted = true options = #( 'Bern' 'Zurich' ... ) :SingleOptionDescription label = 'Address' :Container description
  10. Other “Interpreters” ‣ Viewer building ‣ Editor building ‣ Report

    building ‣ Documentation ‣ Data validation ‣ Query processing ‣ Object filtering ‣ Object serialization ‣ Object copying ‣ Object indexing ‣ Object initialization ‣ Object extension ‣ Object adaption ‣ Object customization and much more ...
  11. Object Description Type Object * * description attributes 1 *

    (b) Magritte onent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  12. Object Description Type Object * * description attributes 1 *

    (b) Magritte onent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  13. Object Description Type Object * * description attributes 1 *

    (b) Magritte onent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  14. Discussion ‣ Very powerful and flexible ‣ Runtime adaptive code

    ‣ End-user programmable code ‣ Can cause meta meta-confusion ‣ Can be slow
  15. scanIdentifier self step. ((currentCharacter between: $A and: $Z) or: [

    currentCharacter between: $a and: $z ]) ifTrue: [ [ self recordMatch: #IDENTIFIER. self step. (currentCharacter between: $0 and: $9) or: [ (currentCharacter between: $A and: $Z) or: [ currentCharacter between: $a and: $z ] ] ] whileTrue. ^ self reportLastMatch ]
  16. #( #[1 0 9 0 25 0 13 0 34

    0 17 0 40 0 21 0 41] #[1 0 9 0 25 0 13 0 34 0 93 0 76 0 157 0 112] #[1 2 38 0 21 2 38 0 25 2 38 0 26 0 13 0 34] #[0 1 154 0 16 0 21 0 25 0 26 0 34 0 40 0 41] #[0 1 210 0 76 0 81] #[0 1 214 0 76 0 81] #[1 0 173 0 76 0 177 0 81] #[0 1 134 0 16 0 21 0 25 0 26 0 34 0 40 0 41] #[1 1 46 0 21 1 46 0 25 1 46 0 26 1 69] #[1 1 54 0 21 1 54 0 25 1 54 0 26 1 54 0 34] #[0 2 102 0 21 0 25 0 26 0 34 0 40 0 41 0 76] #[0 2 50 0 21 0 25 0 26 0 76 0 79] #[1 1 13 0 76 2 85 0 124 1 21 0 125] #[1 2 89 0 17 2 30 0 21 2 30 0 82] #[1 2 93 0 21 2 97 0 82] )
  17. letter letter digit sequence choice many id  :=  #letter  asParser

     ,  (#letter   asParser  /  #digit  asParser)  star
  18. Discussion ‣ The LEGO model ‣ New parts can be

    easily created ‣ Smalltalk provides elegant composition with binary operators
  19. Other Users ‣ Brazil Widgets in Newspeak ‣ Seaside and

    Pier Widgets ‣ Refactoring Engine Change Objects
  20. Language Concern Context Menus Navigation Search Code Expansion Code Completion

    Error Correction Custom Inspector Refactorings Code Folding Highlighting Code Execution
  21. Discussion ‣ Very generic and powerful ‣ Usually requires extra

    infrastructure (for example Helvetia) ‣ Might be difficult to learn and apply
  22. Other Users ‣ Refactoring Engine Rewrite Rules ‣ Compiler Hacks

    (ok, not really) ‣ XML, XSD Transformations ‣ SOUL, IntensiVE
  23. ‣ Subclassing ‣ Extending ‣ Meta-Modeling ‣ Meta Meta-Modeling ‣

    Composing ‣ Transforming }How to make “tools” and “languages” extensible?