The Dynamic Language
is not Enough
Lukas Renggli
Static Software
Static Software
Constant
Static Software
Constant
Fixed
Static Software
Constant
Fixed
Final
Dynamic Software
Dynamic Software
Adaptive
Dynamic Software
Adaptive
Extensible
Dynamic Software
Adaptive
Customizable
Extensible
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-(
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-(
:-|
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-|
Static
Language
Dynamic
Software
:-|
Static
Language
Dynamic
Software
:-(
:-|
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-(
:-|
:-S
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-S
Dynamic
Language
Static
Software
no support
easier
can always get
away with reflection
faster
don’t knowhow to do it
to...
:-(
:-|
:-S
:-)
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-)
Dynamic
Language
Dynamic
Software
1
Subclassing
2
Extending
3
Meta-Modeling
4
Meta Meta-Modeling
5
Composing
6
Transforming
Subclassing
2
Extending
3
Meta-Modeling
4
Meta Meta-Modeling
5
Composing
6
Transforming
Subclassing Extending
3
Meta-Modeling
4
Meta Meta-Modeling
5
Composing
6
Transforming
Subclassing Extending
Meta-Modeling
4
Meta Meta-Modeling
5
Composing
6
Transforming
Subclassing Extending
Meta-Modeling Meta Meta-Modeling
5
Composing
6
Transforming
Subclassing Extending
Meta-Modeling Meta Meta-Modeling
Composing
6
Transforming
Subclassing Extending
Meta-Modeling Meta Meta-Modeling
Composing Transforming
He vetia
Subclassing
The framework for developing
sophisticated web applications
in Smalltalk
Add new functionality by
adding a new subclass.
WAComponent
renderContentOn:
WAComponent
renderContentOn:
MyComponent
renderContentOn:
Template Method
Extensible
Customizable
Adaptable
WAToolPlugin
label
execute
WANewSession... WATiming...
WAToolPlugin
label
execute
...
WAToolPlugin
label
execute
allPlugins
self	
  allSubclasses
collect:	
  [	
  :each	
  |	
  each	
  new	
  ]
WAHaloPlugin
label
execute
allPlugins
self	
  allSubclasses
collect:	
  [	
  :each	
  |	
  each	
  new	
  ]
Discussion
‣ Template Method Pattern
‣ Simple
‣ Lightweight
‣ Portable
‣ No extra infrastructure
Other Users
‣ Monticello Repository Types
‣ OmniBrowser Commands
‣ Code Critics Rules
‣ TextLint Rules (later today)
‣ Pie...
Extending
Add new functionality by
adding a new method.
menuCommandOn:	
  aBuilder
	
   <worldMenu>
	
   (aBuilder	
  item:	
  'Shout	
  Workspace')
	
   	
   parent:	
  #Tools;
...
menuCommandOn:	
  aBuilder
	
   <worldMenu>
	
   (aBuilder	
  item:	
  'Shout	
  Workspace')
	
   	
   parent:	
  #Tools;
...
Discussion
‣ Simple
‣ Lightweight
‣ Long utility methods
‣ Encourages class-extensions
Alternatives to Pragmas
‣ Naming convention for selector names
‣ Naming convention for protocol names
‣ All methods of a s...
Other Users
‣ Pier Value Links
‣ Pharo Compiler Primitives, System
Settings
‣ OmniBrowser Commands, Obsolete
Commands, and...
Meta-Modeling
Create a first-class
description of the domain.
Environment
Environment Category
Environment Category
Environment
Class
Comment
Metaclass
Category
Environment
Class
Comment
Metaclass
Protocol
Category
AllProtocol
Environment
Class
Comment
Metaclass
Protocol
MethodCategory
AllProtocol
OB-Web
OB-Mars
Discussion
‣ UI independent
‣ Domain-specific reflection
‣ Extensible using subclassing/extending
‣ Can cause meta-confusion...
Other Users
‣ GLORP Relational Object Mapping
‣ Glamour Browser Model
‣ Monticello Code Model
‣ Announcement Event Model
‣...
Meta Meta-Modeling
Create a first-class
description of the
description of the
domain.
Address Object
street = 'Schützenmattstrasse'
plz = 3012
place = 'Bern'
canton = 'Bern'
:Address
Address Description
street = 'Schützenmattstrasse'
plz = 3012
place = 'Bern'
canton = 'Bern'
:Address
label = 'Street'
:St...
result	
  :=	
  anAddress	
  asMorph
	
   addButtons;
	
   addWindow;
	
   callInWorld
Morphic Interpreter
result	
  :=	
  self	
  call:	
  (anAddress	
  asComponent
	
   addValidatedForm;
	
   yourself).
Seaside Interpreter
*
*
*
Other “Interpreters”
‣ Viewer building
‣ Editor building
‣ Report building
‣ Documentation
‣ Data validation
‣ Query proce...
Domain Model
Metamodel
Meta-
Metamodel
<described-by>
<described-by>
Developer
End User
Domain Model
Metamodel
Meta-
Metamodel
Magritte
Developer
<described-by>
<described-by>
Magritte
End User
Object
Description
Type
Object
*
*
description
attributes
1 *
(b) Magritteonent Object
*
attributes
1 *
nent
erty
Object
D...
Object
Description
Type
Object
*
*
description
attributes
1 *
(b) Magritteonent Object
*
attributes
1 *
nent
erty
Object
D...
Object
Description
Type
Object
*
*
description
attributes
1 *
(b) Magritteonent Object
*
attributes
1 *
nent
erty
Object
D...
Adaptive
Object Model
Run-time
End users
customizability
Demo
Discussion
‣ Very powerful and flexible
‣ Runtime adaptive code
‣ End-user programmable code
‣ Can cause meta meta-confusio...
Other Users
‣ Gjallar Issue Tracker
‣ DabbleDB Online Database
Composing
Build something new
by composing existing
parts.
scanIdentifier
	 self step.	
	 ((currentCharacter between: $A and: $Z) or:
[ currentCharacter between: $a and: $z ]) ifTrue...
#(	#[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...
Scannerless
Parser Combinator
a..z a..z
0..9
ID	
  ::=	
  letter	
  {	
  letter	
  |	
  digit	
  }	
  ;
letter
letter digit
sequence
choice
many
ID	
  ::=	
  letter	
  {	
  letter	
  |	
  digit	
  }	
  ;
letter
letter digit
sequence
choice
many
id	
  :=	
  #letter	
  ,	
  (#letter	
  /	
  #digit)	
  star
letter
letter digit
sequence
choice
many
id	
  :=	
  #letter	
  asParser	
  ,	
  (#letter	
  
asParser	
  /	
  #digit	
  a...
Smalltalk
+ SQL Language
+ Regular Expression
= Customized Smalltalk
Discussion
‣ The LEGO model
‣ New parts can be easily created
‣ Smalltalk provides elegant composition
with binary operato...
Other Users
‣ Brazil Widgets in Newspeak
‣ Seaside and Pier Widgets
‣ Refactoring Engine Change Objects
Transforming
He vetia
Build something new
by transforming existing
parts.
Language
Scope
Language
Concern
Language
Change
Language
Box
Language Scope
Active?
Language Scope
‣ System
‣ Packages
‣ Classes
‣ Methods
Language Scope
Language Concern
Semantics
Language Concern
Transformation
Language Concern
Context Menus
Navigation Search
Code Expansion
Code Completion
Error Correction
Custom Inspector
Refactor...
Language Change
Syntax
Language Change
Smalltalk
Language Change
Smalltalk
+ SQL Language
Language Change
Smalltalk
+ SQL Language
+ Regular Expression
Smalltalk
+ SQL Language
+ Regular Expression
= Custom Host Language
Language Change
Demo
Discussion
‣ Very generic and powerful
‣ Usually requires extra infrastructure (for
example Helvetia)
‣ Might be difficult ...
Other Users
‣ Refactoring Engine Rewrite Rules
‣ Compiler Hacks (ok, not really)
‣ XML, XSD Transformations
‣ SOUL, Intens...
Anything Else?
‣ Subclassing
‣ Extending
‣ Meta-Modeling
‣ Meta Meta-Modeling
‣ Composing
‣ Transforming
}How to make “tools”
and “langua...
How to make the “object
model” extensible?
Albedo
Jorge Ressia
Object
Class
Object
Structural
Meta-object
Class
Object
Structural
Meta-object
Class
Behavioral
Meta-object
:-(
:-|
:-S
:-)
Static
Language
Dynamic
Language
Static
Software
Dynamic
Software
:-)
lukas-renggli.ch
@renggli
Dynamic Software
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
The Dynamic Language is not Enough
Upcoming SlideShare
Loading in …5
×

The Dynamic Language is not Enough

1,527 views
1,480 views

Published on

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.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,527
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
8
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

The Dynamic Language is not Enough

  1. 1. The Dynamic Language is not Enough Lukas Renggli
  2. 2. Static Software
  3. 3. Static Software Constant
  4. 4. Static Software Constant Fixed
  5. 5. Static Software Constant Fixed Final
  6. 6. Dynamic Software
  7. 7. Dynamic Software Adaptive
  8. 8. Dynamic Software Adaptive Extensible
  9. 9. Dynamic Software Adaptive Customizable Extensible
  10. 10. Static Language Dynamic Language Static Software Dynamic Software
  11. 11. :-( Static Language Dynamic Language Static Software Dynamic Software
  12. 12. :-( :-| Static Language Dynamic Language Static Software Dynamic Software
  13. 13. :-| Static Language Dynamic Software
  14. 14. :-| Static Language Dynamic Software
  15. 15. :-( :-| Static Language Dynamic Language Static Software Dynamic Software
  16. 16. :-( :-| :-S Static Language Dynamic Language Static Software Dynamic Software
  17. 17. :-S Dynamic Language Static Software no support easier can always get away with reflection faster don’t knowhow to do it too complex out-of-the-box
  18. 18. :-( :-| :-S :-) Static Language Dynamic Language Static Software Dynamic Software
  19. 19. :-) Dynamic Language Dynamic Software
  20. 20. 1 Subclassing 2 Extending 3 Meta-Modeling 4 Meta Meta-Modeling 5 Composing 6 Transforming
  21. 21. Subclassing 2 Extending 3 Meta-Modeling 4 Meta Meta-Modeling 5 Composing 6 Transforming
  22. 22. Subclassing Extending 3 Meta-Modeling 4 Meta Meta-Modeling 5 Composing 6 Transforming
  23. 23. Subclassing Extending Meta-Modeling 4 Meta Meta-Modeling 5 Composing 6 Transforming
  24. 24. Subclassing Extending Meta-Modeling Meta Meta-Modeling 5 Composing 6 Transforming
  25. 25. Subclassing Extending Meta-Modeling Meta Meta-Modeling Composing 6 Transforming
  26. 26. Subclassing Extending Meta-Modeling Meta Meta-Modeling Composing Transforming He vetia
  27. 27. Subclassing
  28. 28. The framework for developing sophisticated web applications in Smalltalk
  29. 29. Add new functionality by adding a new subclass.
  30. 30. WAComponent renderContentOn:
  31. 31. WAComponent renderContentOn: MyComponent renderContentOn:
  32. 32. Template Method
  33. 33. Extensible Customizable Adaptable
  34. 34. WAToolPlugin label execute
  35. 35. WANewSession... WATiming... WAToolPlugin label execute ...
  36. 36. WAToolPlugin label execute allPlugins self  allSubclasses collect:  [  :each  |  each  new  ]
  37. 37. WAHaloPlugin label execute allPlugins self  allSubclasses collect:  [  :each  |  each  new  ]
  38. 38. Discussion ‣ Template Method Pattern ‣ Simple ‣ Lightweight ‣ Portable ‣ No extra infrastructure
  39. 39. Other Users ‣ Monticello Repository Types ‣ OmniBrowser Commands ‣ Code Critics Rules ‣ TextLint Rules (later today) ‣ Pier Commands, Views, Structures ‣ Magritte Description Types
  40. 40. Extending
  41. 41. Add new functionality by adding a new method.
  42. 42. menuCommandOn:  aBuilder   <worldMenu>   (aBuilder  item:  'Shout  Workspace')     parent:  #Tools;     action:  [  self  open  ]
  43. 43. menuCommandOn:  aBuilder   <worldMenu>   (aBuilder  item:  'Shout  Workspace')     parent:  #Tools;     action:  [  self  open  ] PragmaCollector  allSystemPragmas      select:  [  :each  |  each  keyword  =  #worldMenu  ] }
  44. 44. Discussion ‣ Simple ‣ Lightweight ‣ Long utility methods ‣ Encourages class-extensions
  45. 45. Alternatives to Pragmas ‣ Naming convention for selector names ‣ Naming convention for protocol names ‣ All methods of a specific class
  46. 46. Other Users ‣ Pier Value Links ‣ Pharo Compiler Primitives, System Settings ‣ OmniBrowser Commands, Obsolete Commands, and Browser Meta-Model
  47. 47. Meta-Modeling
  48. 48. Create a first-class description of the domain.
  49. 49. Environment
  50. 50. Environment Category
  51. 51. Environment Category
  52. 52. Environment Class Comment Metaclass Category
  53. 53. Environment Class Comment Metaclass Protocol Category AllProtocol
  54. 54. Environment Class Comment Metaclass Protocol MethodCategory AllProtocol
  55. 55. OB-Web
  56. 56. OB-Mars
  57. 57. Discussion ‣ UI independent ‣ Domain-specific reflection ‣ Extensible using subclassing/extending ‣ Can cause meta-confusion ‣ Can be limiting or slow
  58. 58. Other Users ‣ GLORP Relational Object Mapping ‣ Glamour Browser Model ‣ Monticello Code Model ‣ Announcement Event Model ‣ Magritte Meta-Model
  59. 59. Meta Meta-Modeling
  60. 60. Create a first-class description of the description of the domain.
  61. 61. Address Object street = 'Schützenmattstrasse' plz = 3012 place = 'Bern' canton = 'Bern' :Address
  62. 62. 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' :Containerdescription
  63. 63. result  :=  anAddress  asMorph   addButtons;   addWindow;   callInWorld Morphic Interpreter
  64. 64. result  :=  self  call:  (anAddress  asComponent   addValidatedForm;   yourself). Seaside Interpreter * * *
  65. 65. 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 ...
  66. 66. Domain Model Metamodel Meta- Metamodel <described-by> <described-by> Developer End User
  67. 67. Domain Model Metamodel Meta- Metamodel Magritte Developer <described-by> <described-by> Magritte End User
  68. 68. Object Description Type Object * * description attributes 1 * (b) Magritteonent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  69. 69. Object Description Type Object * * description attributes 1 * (b) Magritteonent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  70. 70. Object Description Type Object * * description attributes 1 * (b) Magritteonent Object * attributes 1 * nent erty Object Description Type Object * * description attributes 1 * (b) Magritte t Object Description Type Object * * description attributes 1 * (b) Magritte
  71. 71. Adaptive Object Model Run-time
  72. 72. End users customizability
  73. 73. Demo
  74. 74. Discussion ‣ Very powerful and flexible ‣ Runtime adaptive code ‣ End-user programmable code ‣ Can cause meta meta-confusion ‣ Can be slow
  75. 75. Other Users ‣ Gjallar Issue Tracker ‣ DabbleDB Online Database
  76. 76. Composing
  77. 77. Build something new by composing existing parts.
  78. 78. 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 ]
  79. 79. #( #[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] )
  80. 80. Scannerless Parser Combinator
  81. 81. a..z a..z 0..9 ID  ::=  letter  {  letter  |  digit  }  ;
  82. 82. letter letter digit sequence choice many ID  ::=  letter  {  letter  |  digit  }  ;
  83. 83. letter letter digit sequence choice many id  :=  #letter  ,  (#letter  /  #digit)  star
  84. 84. letter letter digit sequence choice many id  :=  #letter  asParser  ,  (#letter   asParser  /  #digit  asParser)  star
  85. 85. Smalltalk + SQL Language + Regular Expression = Customized Smalltalk
  86. 86. Discussion ‣ The LEGO model ‣ New parts can be easily created ‣ Smalltalk provides elegant composition with binary operators
  87. 87. Other Users ‣ Brazil Widgets in Newspeak ‣ Seaside and Pier Widgets ‣ Refactoring Engine Change Objects
  88. 88. Transforming He vetia
  89. 89. Build something new by transforming existing parts.
  90. 90. Language Scope Language Concern Language Change Language Box
  91. 91. Language Scope Active?
  92. 92. Language Scope
  93. 93. ‣ System ‣ Packages ‣ Classes ‣ Methods Language Scope
  94. 94. Language Concern Semantics
  95. 95. Language Concern Transformation
  96. 96. Language Concern Context Menus Navigation Search Code Expansion Code Completion Error Correction Custom Inspector Refactorings Code Folding Highlighting Code Execution
  97. 97. Language Change Syntax
  98. 98. Language Change Smalltalk
  99. 99. Language Change Smalltalk + SQL Language
  100. 100. Language Change Smalltalk + SQL Language + Regular Expression
  101. 101. Smalltalk + SQL Language + Regular Expression = Custom Host Language Language Change
  102. 102. Demo
  103. 103. Discussion ‣ Very generic and powerful ‣ Usually requires extra infrastructure (for example Helvetia) ‣ Might be difficult to learn and apply
  104. 104. Other Users ‣ Refactoring Engine Rewrite Rules ‣ Compiler Hacks (ok, not really) ‣ XML, XSD Transformations ‣ SOUL, IntensiVE
  105. 105. Anything Else?
  106. 106. ‣ Subclassing ‣ Extending ‣ Meta-Modeling ‣ Meta Meta-Modeling ‣ Composing ‣ Transforming }How to make “tools” and “languages” extensible?
  107. 107. How to make the “object model” extensible?
  108. 108. Albedo Jorge Ressia
  109. 109. Object Class
  110. 110. Object Structural Meta-object Class
  111. 111. Object Structural Meta-object Class Behavioral Meta-object
  112. 112. :-( :-| :-S :-) Static Language Dynamic Language Static Software Dynamic Software
  113. 113. :-) lukas-renggli.ch @renggli Dynamic Software

×