Self David Ungar & Randall B. Smith
1 Self timeline
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
2 Before Self
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee UCB Ungar PARC Smith
EuroPARC
3 Randy & Dave Randy: Theoretical Physics simple models w/ broad explanatory power moves to Xerox PARC in 1984 Dave: EE/CS (Susan Graham taught me programming languages) object-oriented language implementation moves to Stanford in 1985, consults at PARC
4 SOAR: Smalltalk on a RISC
330 ns micro beats 70 ns ECL Dorado mini The lesson: compilation load a load b add a, b, c add store c
(1985)
5 Smalltalk
To be a Creative Medium Usable by children E.g.: Kay’s Dynabook Pure Object-Oriented language Invented window-menu-mouse paradigm Had evolved ST-72, ST-76, ST-80 What is Smith to do there?
6 Alternate Reality Kit (ARK)
7 Key ideas in ARK
Objects seem real Uniformity: everything a physical object Messages instead of variables ...and...
8 Key ideas in ARK
... Prototypes
9 ARK
Randy talks over the video
10 Inventing the Language
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
11 Smalltalk group: ST 72, 76, 80, What to do in 85?
Split up into small teams to create strawmen for next language
12 Ungar meets Smith
ARK and Dancing CPUs tangible, physical, can do unexpected Ungar suggests attaching CPU to job Join forces to devise strawman w/ objects as real as in ARK
ca. 1986
13 Match language to mental models
We drew objects with names and contents
14 Smalltalk didn’t q uite
+ names “x, y”
Instances vs. Classes 3 4
Why not put names, + contents, even code in x 3 the object? y 4
15 Smalltalk fantastic, but... Emphasized classes not objects:
Emphasized tools not objects:
Set the standard for today; e.g. Eclipse
16 Classes & Metaclasses in Smalltalk (from Goldberg & Robson, p. 272)
SmallInteger Integer Number class class class
SmallInteger Integer Number
Class
ClassDescription Behavior Object
Class class
ClassDescription Behavior Object class class class Metaclass
Metaclass Legend class instantiation (is a) inheritance (is a kind of)
7/21/92 12
17 We threw out
Classes Metaclasses Class, Pool, Global variables Dave: inspired by lunch w/ Peter Deutsch Randy’s reasons: (Robson on Pascal) Access/assignment syntax everything “runs” magic assignment primitive
18 We added implicit “self” self a: self b + self c a: b + c slot list syntax instanceVariableNames: ‘x y’ new (| x <- 0. y <- 0 |) x <- 0. y <- 0. parent slots objects inherit from objects “global” state for free
19 Pushing Simplicity
number story slot name story
20 Changing state to behavior
parent* deposit: amt (balance: balance + amt) withdraw: amt (balance: balance - amt)
parent* balance (pricePerShare * nShares) parent* balance 124 balance: amt (nShares: amt / balance: <- pricePerShare) pricePerShare 22 pricePerShare: p <- nShares 100 nShares: n <- Self talk for BTL 1/12/94 21
21
Self talk for BTL 5/5 January 12, 1994 The Self paper
Self: The Power of Simplicity Ungar & Smith OOPSLA’87
Today >700 citations A “most influential” paper in first decade of OOPSLA
22 The Danish Connection
OOPSLA’89 - virtual classes - Ole Lehrmann-Madsen Ole Agesen Lars Bak Krysten Nygaard (not Danish) ECOOP’95
23 Doing the impossible: the VM
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
24 Self-89 Summary
1988-1989: Aspired to Smalltalk performance 33,000 lines C++, Chambers, Ungar, Lee 2-10 MIPS machines then, ~1,000 MIPS today 1st implementation of maps customization message splitting type prediction dependency lists
25 Maps video OOPSLA’89
26 Craig’s compilation video
OOPSLA’89
27 OOPSLA’89
28 OOPSLA’89
29 OOPSLA’89
30 Crazy Trip Not to scale
Agile lazyness
PICs, compile speed CFG deferred
y uncommon cases
Clunk Slow run speed Fast
Self-89 Self-90 Self-91 Self-93
31 Goodbye Stanford
One year before tenure, Ungar approached by Sun Choose between Apple & Sun Wayne Rosing & Bill Joy recruit us to Sun We started at Sun Jan. 1991
32 Optimizing Dynamically-Typed Object-Oriented Languages With Polymorphic Inline Caches
Urs Hölzle Craig Chambers David Ungar
Stanford University
5/31/92 1 of 32 From Hölzle PLDI-92 PIC talk
33 Our Solution: Polymorphic Inline Caches
system lookup handler
call squPIC_stubare_area "area" PIC
calling method receiver = ? receiver = ?
method body method body
area method for circles area method for squares
5/31/92 12 of 32 From Hölzle PLDI-92 PIC talk
34 Future Work: Adaptive Compilation
• problem: optimizations are expensive - compilation at run-time makes compile time more visible to user • solution: optimize only critical parts - 80/20 rule of thumb - recompilation can take advantage of PICs to generate better code • could minimize compile pauses - can use very fast initial compiler - recompilation in background or during think pauses • we are currently implementing such a system
5/31/92 From Hölzle PLDI-92 PIC talk 30 of 32
35 Self-93: Urs Gets Lazy
Breakthrough: combines speed w/ agility Machine: 28.5 MIPS Speed: 1.5x Self-91 (i.e. 50% opt. C++) Agility: startup time reduced from 90 to 30 secs. pauses while interacting under 0.1 sec
36 Self has a big runtime (See “A Third-Generation Self Implementation,” Hölzle, Ungar) • Self 4.0 needs a 32MB mach. (incl Solaris & X) • Big runtime buys performance: – 40% of optimized C, – same as C++ with many virtuals • Big runtime buys responsiveness – can make large changes made in a second • Big runtime buys programming time – full source-level debugging, fix & continue on optimized code • Big runtime buys uniformity – all arithmetic & control via message passing – can “subclass” 17, redefine “+”, add “maybe” • & many ways to shrink Self: – interpreter for unopt. code, hardwire control
David Ungar, Sun Microsystems Laboratories OOPSLA’94 Prototypes Panel, - - 10/25/94 37 Modularity: Monolithic image: Hard to deliver small applications?
Transporter: does suport modules – fine granularity Sifting Out the Gold: Delivering Compact Applications from an Exploratory Object-Oriented Programming Environment -- Ole Agesen & D. Ungar
Extracto 5 minutes Full image with Shrinkwrapped diff: 10 Mb image diff: 0.8Mb image
David Ungar, Sun Microsystems Laboratories OOPSLA’94 Prototypes Panel, - - 10/25/94 38 Animated Objects
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
39 Make Objects Real
Disneyland ride: Objects, not browsers Exploits bigger screens Each object has own representation on the screen one and only one Global prototypes just slots in objects Kept “categories” from Smalltalk
40 Challenge: Hardware
Started w/ Monochrome, direct-mapped framebuffer (1989) Pixrects library Then 8-bit frame buffer, grayscale colormap tricks for 30 fps 8-bit color (by 1993)
41 ConeTrees
Cone Trees: animated 3d visualizations. . . Robertson, Mackinlay, Card, CHI’91
42 Cartoon Animation
David & four-year-old son Leo watched cartoons Fancy Sony VCR with exceptional jog-shuttle Read “Disney Animation: The Illusion of Life” Thomas & Johnston Watched Tiny Tunes w/ Randy every day at 4:00 1991
43 Motion is not just a series of still pictures!
Motion Blur (stutter or streak) slow medium fast blur
x x x x
time time time time
Anticipation
Slow in/Slow out F = ma 12-20-93 UIST
44
44
David Ungar 1 December 20, 1992 Best Christmas
Sat in office day after day getting motion blur right, then follow-through Could have only done it in Self
1991 or 1992
45 UIST’93 Demo
46 UI2 & Outliner
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
47 UI2 (Morphic) Key Concepts
Direct UI Construction Use / Mention Unified Layout as object
48 Inspired by MORE, showed objects as outlines
49 Self 4 (1995) Demo
50 Kansas a large flat space with several people in it
51 Kansas
Actually used for distributed work Embodied WYSIWITYS principle Importance often not appreciated in collaborative systems.
52 Selling Self to Sun
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
53 1 B
Self as an Investment
Randy Smith & David Ungar
John Maloney
Ole Agesen, Craig Chambers, Bay-Wei Chang, Urs Hoelzle
Randy
May 12, 1991
Self business presentation 54
54 2 B
Significance of success to Sun
• Sun ships powerful, cheap, hardware • that no one can • set up • turn on • receive mail on • We hope to make it easier for you to use and adapt to your purposes • Significance: • opens the way to down-market expansion • makes specialized applications much cheaper • puts Sun in the language business
• OK? or not OK? May 12, 1991
55
55 5 B
Reminder of Cost to SunLabs
• 6 lunatics • state-of-the-art machines • 5 years
May 12, 1991
56
56 Watch Demo for User Interface Look and Feel Who are the customers?
• Today’s interfaces startle and confuse customers Self • With sudden flashes and teleportation
apppropriateness Visual Basic • Self harnesses cartoon animation tricks to clarify and Clarity calm events on the screen • Can reduce comprehension time C++ • Reinforces the illusion that Self objects are concrete and real • Result: • A pleasant and productive experience for the customer 100 101 102 103 104 105 106 number of lines in typical program button adders scripters telescope aimers user interface Framemaker builders makers
57 Self talk for Scott, 6-18-93 57
Self How Can Self Help Sun Make Money?
• Self could be application builder for DOE • Self scripts tie together DOE objects • Self could be easy source of DOE objects • Rapid construction of lots of DOE objects to put in DOE world
DOE
a DOE application Self
David Ungar 3 June 18, 1993 Self is for casual programmers who get serious
Quick, easy, & fun Runs fast
Self
Uniform, expressive
Self @ Language Day, Smith & Ungar, 8/18/94 Sun Microsystems Laboratories, pp.
58 Production quality applications?
• Footprint is an issue: – full system takes 20Mb real memory » close to fitting on 32MB machine » will fit by December • Recent type inference work of Agesen et. al. very hopeful about extracting only relevant objects from the web of objects comprising the Self system. – Example: » diff • in 5 five minutes, extracted 7,000 lines of source from full environment » diff runs in 3Mb virtual space
(continued...)
Self @ Language Day, Smith & Ungar, 8/18/94 Sun Microsystems Laboratories, pp.
59 Result: Memory vs. Productivity
• Memory Overhead
! Costs: about 16Mb (" $250?) (maybe even $500) • Execution Speed: fast enough for animated UI
! 3x - 6x slower than optimized C
! 20% faster than fully virtual C++ ! 2.5x faster than Smalltalk • First-time Compilation Speed (80K line program)
! Self: 3 mins, C++: 1.5 hrs (debug) • Recompilation Speed after adding a slot
! Self: 1 sec C++: 1 5 hours
Schmidt/Kanagaard slides 9-9-93
David Ungar 2 4 November 18, 1993 60
60 You know it’s bad when Last manager gives us a book about marketing Last manager interprets lab director’s remarks for us:
means
means
61 Project Cancelled!
Bert Sutherland, lab director, gives us “the letter” Toughest moment in Dave’s career Project was complete, on-time, under budget Nicest possible cancellation nine months to wrap it up
62 At DevPro’s request, worked on A Smalltalk Product • Researched market: in Object Oriented Strategies V(3), pg 5: – Smalltalk = 19% of total = $71M (up 30%) – Predict ST will continue to be fastest growing OOL
– PPS Sun ST revenues ~ $10M in 1994
• Built World’s Fastest Smalltalk System (in 1 week) – Can read in Smalltalk program, browse like Smalltalk, run • No other Smalltalk system can match these – >2x faster than ParcPlace – can shrinkwrap standalone application • DevPro declined in favor of other projects • Question: Is there some real money here? – Should we keep this warm?
5/18/95
63 Two of us vanish mysteriously
Like Craig, hoped that Urs would consult after his Ph.D. but he refused and would not say what he was doing After a vacation, Dave came back to find Lars gone! would not say what he was doing Later Dave & Randy poked heads into nearby building; later found out Lars, Urs were hiding
64 HotSpot JVM
Urs, Lars go to Animorphic Join others do Strongtalk Smalltalk w/ optional types Interpreter instead of dumb compiler (footprint) Do Java VM as insurance Acquired by Sun supersedes Exact VM (Wolczko, Agesen) SPARC port (familiar code)
65 Looking back
1985 1990 1995 2000
Bak Maloney Wolczko Sun
Agesen Hoezle Stanford Chang Chambers Lee Ungar PARC Smith
EuroPARC
66 We published
Over 30 refereed publications 4 Stanford dissertations Two “most influential paper” awards Over 2,000 total citations (scholar.google.com)
67 Self influenced almost every Java Virtual Machine NewtonScript, JavaScript look of animated interfaces Squeak & Flair UI architecture object-oriented language research Klein & Maxwell metacircular VM research
68 Kept Self Alive
Port to Mac Port to OS X Port to Intel Mac Replaced QuickDraw with Quartz
http://research.sun.com/self/ (email [email protected] for newer files)
69 Fostering Creativity At the time, it was about making programming easier Now, I think about creativity Instant feedback to conserve demands on memory Space & arrows offload cognitive burden Automatic inlining methods & blocks frees programmer from performance worries Live objects let programmer try things easily Language simplicity, uniformity fosters unanticipated reuse
70 Conclusion
Self a success in marketplace of ideas What else was needed? Most programmers just want to solve a problem “What new thing can I do?” “Do I really have to learn a new way to think?”
71 The Unpopularity of Simplicity?
Simple base language + first-class extensibility Has not caught on Java: keeps growing in complexity JavaScript: keeps growing in complexity PERL, Ruby: complex and growing in complexity Why?
72 Conclusions Designed impractical, pure language Made it practical Built object-centric animated environment Built direct-manipulation UI construction Built collaborative programming environment Built type-inferencer for dynamic types Not considered product-worthy Nothing quite like it today
73