Bifrost: Setting Smalltalk Loose

2,573 views

Published on

Presentation at ESUG 2011

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

  • Be the first to like this

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

No notes for slide
  • \n
  • repeated at 40th anniversary of “Mother of all demos”\nDoug Engelbart sketchpad\nhe meant that we are using computers to enhanced previous ways of thinking. Not to have new ways of thinking.\n
  • \n
  • \n
  • Smalltalk is a very good example of this programming perspective.\n\nDealing with objects is good, and modifying them live is even better.\n
  • \n
  • We still regard our systems as a whole or part of them as static. We still go back to the code to analyze and understand.\nWe still are thinking in a reading paradigm\n
  • \n
  • Smalltalk is a very good example of this programming perspective\n
  • Cell keratine\n\nGreen -> DNA\n\nred outer membrane, skin nails, hair.\n
  • \n
  • We still regard our systems as a whole or part of them as static. We still go back to the code to analyze and understand.\nWe still are thinking in a reading paradigm\n
  • We still regard our systems as a whole or part of them as static. We still go back to the code to analyze and understand.\nWe still are thinking in a reading paradigm\n
  • We still regard our systems as a whole or part of them as static. We still go back to the code to analyze and understand.\nWe still are thinking in a reading paradigm\n
  • \n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • \n
  • Code profilers commonly employ execution sampling as the way to obtain dynamic run-time information\n
  • \n
  • is a framework for drawing graphs\n
  • \n
  • \n
  • What is the relationship between this and the domain? picture again\n
  • \n
  • \n
  • \n
  • Fixed the way we think it frames our mind set\n
  • \n
  • \n
  • \n
  • \n
  • This is what we missed from the cell metaphor.\nWe took the structure and communication between cells but not the evolution part.\nCells are capable of creating a human being because they can evolve.\nViruses, cures, medicines, drugs, etc.\n
  • \n
  • This is what we missed from the cell metaphor.\nWe took the structure and communication between cells but not the evolution part.\nCells are capable of creating a human being because they can evolve.\nViruses, cures, medicines, drugs, etc.\n
  • I am going to talk about 4 applications that were conceived by breaking loose from the object model.\n
  • \n
  • We have to go back to the code\n
  • We have to go back to the code\n
  • \n
  • \n
  • Between the questions that we ask ourselves and the solutions that our tools provide.\nAvoid going to the code. (going static)\nremain dynamic, interacting with the objects and if necessary make them evolve.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • Clicking and drag-and-dropping nodes refreshes the visualization, thus increasing the progress bar of the corresponding nodes. This profile helps identifying unnecessary rendering. We identified a situation in which nodes were refreshing without receiving user actions.\n
  • \n
  • \n
  • \n
  • \n
  • We do not know what to evolve or who should evolve.\nWe need some spreading of the evolution like a disease or cure.\n\nThe adaptation cannot be seen by other objects which are in a different execution.\nThe adaptation is dynamically set.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • The impact to the system is bearable \n
  • \n
  • We have not forgotten about structural changes.\n
  • \n
  • that it is a cool, large and open source platform for data and software analysis that is being increasingly used in industrial projects\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • How do we solve this?\n
  • \n
  • We see that there are many different ways of doing reflection, adaptation, instrumentation, many are low level.\nAnd the ones that are highly flexible cannot break free from the limitations of the language.\n
  • Adaptation semantic abstraction for composing meta-level structure and behavior.\n
  • \n
  • \n
  • \n
  • \n
  • \n
  • \n
  • We have a way of setting free from the assumptions and limitations of the object model.\nWe can experiment and build new abstractions.\nLike the object debugger, talents, meta spy, prisma, back in time debugging, etc.\n
  • We built a tool for breaking the object model and we ended up trying different new things.\n
  • We are not going to be able to find the next “new” thing by fixing more and more the abstractions that we use to think.\nI am not saying that nothing should be fixed.\nWhat I am saying is that sometimes is good to think out of the box and see what are we missing by embracing the advantages of having a fixed world.\nHaving a different point of view.\nBTW the world and its problems are not fixed at all.\n\nProviding a simple and unifying way of evolving objects allowed us to produce all these ideas and tools.\n
  • We are not going to be able to find the next “new” thing by fixing more and more the abstractions that we use to think.\nI am not saying that nothing should be fixed.\nWhat I am saying is that sometimes is good to think out of the box and see what are we missing by embracing the advantages of having a fixed world.\nHaving a different point of view.\nBTW the world and its problems are not fixed at all.\n\nProviding a simple and unifying way of evolving objects allowed us to produce all these ideas and tools.\n
  • works on any pharo version, you can load it now an use any of these tools right away.\n
  • \n
  • Bifrost: Setting Smalltalk Loose

    1. 1. Letting Smalltalk Loose Jorge Ressia www.scg.unibe.ch
    2. 2. Computerrevolution has not happened yet
    3. 3. Computerrevolution has not happened yet Kay997 Alan PSLA 1 O Keynote O
    4. 4. improve previous ways of thinking
    5. 5. create newways of thinking
    6. 6. Object-oriented Programming
    7. 7. Dynamic
    8. 8. We still go back to the source code
    9. 9. Debugging
    10. 10. { { { { } } } } { }
    11. 11. { { { { } } } } { }
    12. 12. { { { { } } } } { }
    13. 13. { { { { } } } } { }
    14. 14. { { { { } } } } { }
    15. 15. { { { { } } } } { }
    16. 16. { { { { } } } } { }
    17. 17. Profiling
    18. 18. Domain-Sp CPU time profiling Mondrian [9] is an open and agile visualization engine. visualization using a graph of (possibly nested) nodes an Profile a serious performance issue was raised1 . Tracking down performance was not trivial. We first used a standard sam Execution sampling approximates the time spent in an by periodically stopping a program and recording the cu under executions. Such a profiling technique is relatively little impact on the overall execution. This sampling techn all mainstream profilers, such as JProfiler, YourKit, xprof MessageTally, the standard sampling-based profiler in P tually describes the execution in terms of CPU consumpt each method of Mondrian: 54.8% {11501ms} MOCanvas>>drawOn: 54.8% {11501ms} MORoot(MONode)>>displayOn: 30.9% {6485ms} MONode>>displayOn:{ { | 18.1% {3799ms} MOEdge>>displayOn: { { ... } | 8.4% {1763ms} MOEdge>>displayOn: } } | | 8.0% {1679ms} MOStraightLineShape>>display:on: | | 2.6% {546ms} FormCanvas>>line:to:width:color: } { } ... 23.4% {4911ms} MOEdge>>displayOn: ... We can observe that the virtual machine spent abou the method displayOn: defined in the class MORoot. A ro nested node that contains all the nodes of the edges of t general profiling information says that rendering nodes a great share of the CPU time, but it does not help in pin and edges are responsible for the time spent. Not all grap consume resources. Traditional execution sampling profilers center their r the execution stack and completely ignore the identity of th the method call and its arguments. As a consequence, it which objects cause the slowdown. For the example above, says that we spent 30.9% in MONode>>displayOn: withou were actually refreshed too often. Coverage PetitParser is a parsing framework combining ideas from parser combinators, parsing expression grammars and pac grammars and parsers as objects that can be reconfigured
    19. 19. CPU time profiling Mondrian [9] is an open and agile visualization engine. Profile visualization using a graph of (possibly nested) nodes an a serious performance issue was raised1 . Tracking down performance was not trivial. We first used a standard sam Execution sampling approximates the time spent in an by periodically stopping a program and recording the cu under executions. Such a profiling technique is relatively little impact on the overall execution. This sampling techn all mainstream profilers, such as JProfiler, YourKit, xprof MessageTally, the standard sampling-based profiler in P tually describes the execution in terms of CPU consumpt each method of Mondrian: 54.8% {11501ms} MOCanvas>>drawOn: 54.8% {11501ms} MORoot(MONode)>>displayOn:{ { 30.9% {6485ms} MONode>>displayOn: { { | 18.1% {3799ms} MOEdge>>displayOn: } ... } } | 8.4% {1763ms} MOEdge>>displayOn: | | 8.0% {1679ms} MOStraightLineShape>>display:on: } { } | | 2.6% {546ms} FormCanvas>>line:to:width:color: ... 23.4% {4911ms} MOEdge>>displayOn: ... We can observe that the virtual machine spent abou the method displayOn: defined in the class MORoot. A ro nested node that contains all the nodes of the edges of t general profiling information says that rendering nodes a great share of the CPU time, but it does not help in pin and edges are responsible for the time spent. Not all grap consume resources. Traditional execution sampling profilers center their r the execution stack and completely ignore the identity of th the method call and its arguments. As a consequence, it which objects cause the slowdown. For the example above, says that we spent 30.9% in MONode>>displayOn: withou were actually refreshed too often. Domain Coverage PetitParser is a parsing framework combining ideas from parser combinators, parsing expression grammars and pac grammars and parsers as objects that can be reconfigured 1 http://forum.world.st/Mondrian-is-slow-next-step-tc a2261116 2 http://www.pharo-project.org/
    20. 20. Mondrian
    21. 21. C omp lexity stemand Ducasse 2003Sy zaLan
    22. 22. little impact on the overall execution. This sampling technique is uall mainstream profilers, such as JProfiler, YourKit, xprof [10], an MessageTally, the standard sampling-based profiler in Pharo Smtually describes the execution in terms of CPU consumption and ieach method of Mondrian:54.8% {11501ms} MOCanvas>>drawOn: 54.8% {11501ms} MORoot(MONode)>>displayOn: 30.9% {6485ms} MONode>>displayOn: | 18.1% {3799ms} MOEdge>>displayOn: ... | 8.4% {1763ms} MOEdge>>displayOn: | | 8.0% {1679ms} MOStraightLineShape>>display:on: | | 2.6% {546ms} FormCanvas>>line:to:width:color: ... 23.4% {4911ms} MOEdge>>displayOn: ... We can observe that the virtual machine spent about 54% othe method displayOn: defined in the class MORoot. A root is thenested node that contains all the nodes of the edges of the visuageneral profiling information says that rendering nodes and edge
    23. 23. Domain-Specific Profiling 3CPU time profiling Which is the relationship?Mondrian [9] is an open and agile visualization engine. Mondrian describes avisualization using a graph of (possibly nested) nodes and edges. In June 2010a serious performance issue was raised1 . Tracking down the cause of the poorperformance was not trivial. We first used a standard sample-based profiler. Execution sampling approximates the time spent in an application’s methodsby periodically stopping a program and recording the current set of methodsunder executions. Such a profiling technique is relatively accurate since it haslittle impact on the overall execution. This sampling technique is used by almostall mainstream profilers, such as JProfiler, YourKit, xprof [10], and hprof. MessageTally, the standard sampling-based profiler in Pharo Smalltalk2 , tex-tually describes the execution in terms of CPU consumption and invocation foreach method of Mondrian:54.8% {11501ms} MOCanvas>>drawOn: 54.8% {11501ms} MORoot(MONode)>>displayOn: 30.9% {6485ms} MONode>>displayOn: ? | 18.1% {3799ms} MOEdge>>displayOn: ... | 8.4% {1763ms} MOEdge>>displayOn: | | 8.0% {1679ms} MOStraightLineShape>>display:on: | | 2.6% {546ms} FormCanvas>>line:to:width:color: ... 23.4% {4911ms} MOEdge>>displayOn: ... We can observe that the virtual machine spent about 54% of its time inthe method displayOn: defined in the class MORoot. A root is the unique non-nested node that contains all the nodes of the edges of the visualization. Thisgeneral profiling information says that rendering nodes and edges consumes agreat share of the CPU time, but it does not help in pinpointing which nodesand edges are responsible for the time spent. Not all graphical elements equallyconsume resources. Traditional execution sampling profilers center their result on the frames ofthe execution stack and completely ignore the identity of the object that receivedthe method call and its arguments. As a consequence, it is hard to track downwhich objects cause the slowdown. For the example above, the traditional profilersays that we spent 30.9% in MONode>>displayOn: without saying which nodeswere actually refreshed too often.CoveragePetitParser is a parsing framework combining ideas from scannerless parsing,
    24. 24. What is theproblem?
    25. 25. Fixed Object Model
    26. 26. Most of the time this is good
    27. 27. Restricts what we can do
    28. 28. Time
    29. 29. Time is a very useful concept
    30. 30. considering itabsolute limit us
    31. 31. absolute object model limit us
    32. 32. objects that evolve
    33. 33. Why?
    34. 34. Debugging ProfilingExecution StructureReification Evolution
    35. 35. Debugging ProfilingExecution StructureReification Evolution
    36. 36. { { { { } } } } { }
    37. 37. { { { { } } } } { }
    38. 38. When is the next state written?
    39. 39. Stop when the nextmessage is received
    40. 40. Close the gap
    41. 41. Object Debugger
    42. 42. Debugging ProfilingExecution StructureReification Evolution
    43. 43. MetaSpy
    44. 44. MetaSpy OLS 2011 TO Ber gel etal.
    45. 45. Mondrian Profiler
    46. 46. C omp lexity stema, Ducasse 2003Sy anz L
    47. 47. Debugging ProfilingExecution StructureReification Evolution
    48. 48. What if we do notknow what to evolve?
    49. 49. ?
    50. 50. Prisma
    51. 51. Scarring
    52. 52. Scanning
    53. 53. Back in time Debugger
    54. 54. Back in time Debugger Debu gger w Floal. ECOOP 2008 O b ject nhard e t Lie
    55. 55. Instance variable history
    56. 56. name value init@t1 null predecessor name value :Person field-write@t2 Doe predecessor name value field-write@t3 Smithperson := Person new t1...name := Doe t2...name := Smith t3
    57. 57. Debugging ProfilingExecution StructureReification Evolution
    58. 58. Talentsscg.unibe.ch/research/talents
    59. 59. Talents ST 2 011F. Perin and IW ie rstrasz, îr ba, O. N gli J. Re ssia, T. G L. Rengscg.unibe.ch/research/talents
    60. 60. Dynamicallycomposable units of reuse
    61. 61. moosetechnology.org
    62. 62. MooseEntity FAMIXEntity ... FAMIXTypeaFAMIXClass isTestClass 2 FAMIXClass Key instance-of isTestClass 1 message send lookup aFAMIXClass self inheritsFrom: TestCase 3
    63. 63. MooseEntity FAMIXEntity ... 3 aJeeClassTalent FAMIXType talent isTestClass aJeeClassTalent FAMIXClassaFAMIXClass 2 inheritsFrom: TestCase 4 aFAMIXClass Key instance-of 1 message send lookup aFAMIXClass acquire isTestClass
    64. 64. Operators• @ alias• - exclusion• , composition
    65. 65. Flattening
    66. 66. Scoping
    67. 67. Evolution friendly Object Model
    68. 68. Organize the Meta-level
    69. 69. ExplicitMeta-objects
    70. 70. Class Meta-object Object
    71. 71. Class Meta-object Object
    72. 72. Class Meta-objectEvolved Object
    73. 73. Object>>haltAtNextMessage | aMetaObject | aMetaObject := BFBehavioralMetaObject new. aMetaObject when: (BFMessageReceiveEvent new) do: [ self metaObject unbindFrom: self. TransparentBreakpoint signal ]. aMetaObject bindTo: self
    74. 74. We let Smalltalk loose
    75. 75. Object PrismaDebuggerSubjectopia MetaSpy Talents Chameleon
    76. 76. scg.unibe.ch/jenkins/
    77. 77. scg.unibe.ch/research/bifrost

    ×