self the power of simplicity david ungar and randall b smith l.
Download
Skip this Video
Loading SlideShow in 5 Seconds..
Self: The Power of Simplicity David Ungar and Randall B. Smith PowerPoint Presentation
Download Presentation
Self: The Power of Simplicity David Ungar and Randall B. Smith

Loading in 2 Seconds...

play fullscreen
1 / 18

Self: The Power of Simplicity David Ungar and Randall B. Smith - PowerPoint PPT Presentation


  • 149 Views
  • Uploaded on

Self: The Power of Simplicity David Ungar and Randall B. Smith. Presenter: Jonathan Aldrich 15-819. History: Smalltalk. First “modern” OO language – Alan Kay, 1970s Everything is an object (e.g., the number 15, the class List) Garbage collection Closures Exploratory programming

loader
I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.
capcha
Download Presentation

PowerPoint Slideshow about 'Self: The Power of Simplicity David Ungar and Randall B. Smith' - paulos


An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -
Presentation Transcript
history smalltalk
History: Smalltalk
  • First “modern” OO language – Alan Kay, 1970s
    • Everything is an object (e.g., the number 15, the class List)
    • Garbage collection
    • Closures
  • Exploratory programming
    • Designed for kids
    • Dynamically typed
    • Add new code/evaluate exprs with no compilation required
  • Extraordinary development environment
    • 10-20 years ago, better than the best IDE today
  • Try it (Squeak)
self s simplicity
Self’s Simplicity
  • No classes (clone objects instead)
  • No variables (use messages)
  • No control structures (use polymorphism)
  • Everything is an object
classes vs prototypes
Classes

Hold behavior

Inherit from another class

Can be instantiated

Objects

Hold state

Are an instance of a class

Prototypes

Hold behavior

Delegate (inherit) to another object

Can be cloned

Hold state

Classes vs. Prototypes
modeling closures
Modeling closures
  • Just prototype objects
    • Cloned when closure is invoked
    • Slots for local variables
    • parent pointer refers to enclosing environment
      • For closures, just the enclosing method
      • For methods, set to receiver object
expressiveness
Expressiveness
  • Examples in paper
    • Sharing state between objects
    • Singleton objects
    • Easily replace variable with method
  • Run-time behavior changes
    • Add/remove methods
    • Dynamic Inheritance: Add/remove/change parent links
dynamic inheritance example
Dynamic Inheritance Example

NormalController

operate = { … if (badness)

parent*: SafetyController

… }

ReactorController

parent*

SafetyController

restart = { … if (safe condition)

parent*: NormalController

… }

checking
Checking
  • Dynamically typed
    • Errors are caught at run time
  • This slide is largely a placeholder
    • Will be important part of discussion in other papers
claimed engineering benefits in addition to expressiveness
Claimed Engineering Benefits(in addition to expressiveness)
  • Concreteness of prototypes
  • Simplicity of cloning
  • [Eliminates infinite meta-regress of Smalltalk]
engineering challenges
Engineering Challenges
  • Are classes too useful to programmers to give up?
  • Difficulty of reasoning about dynamism
  • Typechecking [Andi’s research]
secret agenda
Secret Agenda
  • Development of new language: Plaid
    • Prototype-based
      • Unifies objects, classes, modules
    • Type-safe dynamic inheritance
    • Other features
      • Multi-methods, aspects, typestate, ownership
  • Emphasis: safe component-based SE