SlideShare a Scribd company logo
1 of 27
Smalltalk
The dynamic language




Mohamed Samy
August 2011
samy2004@gmail.com
The Dynabook project - 1968
●   Presented in the paper
      "A Personal Computer for children of all ages"
    by Alan C. Kay
The Dynabook project - 1968
The Dynabook project - 1968
The Dynabook project - 1968
The Dynabook project - 1968
The Dynabook project - 1968
The Dynabook project - 1968
Smalltalk
●   One of the first OOP languages, greatly
    influenced OOP
●   Ideas transferred to C++, Objective-C, Java, C#,
    Ruby, Python, Dylan, ...etc...etc
●   Has intellectual 'children' like Self, which in turn
    influenced IO, JavaScript, and Newspeak
●   Commercial implementations:
    ●   VisualWorks, Dolphin Smalltalk, VA Smalltalk
●   Open source implementations
    ●   Squeak, Pharo, GNU Smalltalk
Pure OOP?

●   What does a language like C++ do in non object-
    oriented ways?
    ●   Primitive data types like int, char, float...
    ●   Control flow like if, while, for
    ●   Functions
    ●   Function names
    ●   Classes (while they can create objects, they are not
        objects).
    ●   The call stack
    ●   Processes/threads
    ●   ...etc
Small syntax
●   Assignment:
        a := 5
●   Message sends:
        obj message
        obj messageWithArg: 12
        obj messageWithArgA: 12 argB: 13
        obj1 + obj2 / obj3
    ●   Note that 1 + 3 * 5 evaluates to 20, since + , * are
        message sends like any other.
Small syntax
●   Messages on top of messages:
      2 squared factorial
●   Message cascading:
    window := ShellView new show.
    window
     position: 80@80;
     extent: 320@90;
     backcolor: Color blue;
     caption: 'Test Window'.
Small syntax
●   Blocks
      myFunc := [ MessageBox notify: 'I have arrived
      mommy' ]
      myfunc value
●   Blocks with args
      myFunc := [ :x | MessageBox notify:
             'I have arrived ' , x]
      myFunc value: 'Tamer'
      myFunc := [ :x :y | x + y ]
      myFunc value: 12 value: 13
Pure OOP?

●   What does a language like C++ do in non object-
    oriented ways?
    ●   Primitive data types like int, char, float...
    ●   Control flow like if, while, for
    ●   Functions
    ●   Function names
    ●   Classes (while they can create objects, they are not
        objects).
    ●   The call stack
    ●   Processes/threads
    ●   ...etc
Primitive types
●   Integers, floats, fractions, booleans...etc are all
    objects
●   They even have a class hierarchy ^ ^
●   The hierarchy allows e.g switching between
    different integral types during program execution,
    making use of the dynamic typing nature of the
    language.
●   Consider
      5 factorial class
      100 factorial class
Control flow
●   If
    ●    cond ifTrue: [block]
    ●    cond ifTrue: [block1] ifFalse: [block2]
●   While/Until
    ●    [cond] whileTrue: [block]
    ●    [cond] whileFalse: [cond]
●   Counting
    ●    5 timesRepeat: [ MessageBox notify: 'hi' ]
    ●    1 to: 10 do: [ :a | MessageBox notify: a printString ]
    ●    1 to: 10 by: 2 do: [ :a | MessageBox notify: a
         printString ]
Let's create a 'whileNot' loop
●   1- Create a class MyLoop and define this method:
    whileNot: cond do: action
    cond value ifFalse: [action value.
                    self whileNot: cond do: action ]
●   2- Let's test our method
    loop = MyLoop new.
    i:=0.
    loop whileNot: [ i=10] do : [i:= i+1].
    MessageBox notify: i printString
Symbols
●   An expression like #abc represents an object
●   Symbols guarantee that the same #... expression
    always returns the same object
●   This guarantee makes comparing symbols very
    fast (compare references instead of strings)
●   Class names, message selectors, ...etc are
    symbols
●   The benefits of this are related to the dynamic
    nature of the language, and will appear shortly
Pure OOP?

●   What does a language like C++ do in non object-
    oriented ways?
    ●   Primitive data types like int, char, float...
    ●   Control flow like if, while, for
    ●   Functions
    ●   Function names
    ●   Classes (while they can create objects, they are not
        objects).
    ●   The call stack
    ●   Processes/threads
    ●   ...etc
Processes & Continuations
clockStep := [Processor sleep: 1000.
(View desktop canvas)
    font: (Font name: 'Arial' pointSize: 36) beBold;
    text: Time now printString at: 10@10;
    free
]
digitalClockProcess := [ clockStep repeat ] fork.
Processes & Continuations
●   A process is an object and, like any other, can be
    sent messages.
●   It knows about its call stack, Smalltalk has support
    for continuations
●   This has a lot of uses...
    ●   Debugging
    ●   Distributed computing
    ●   Continuation-based web frameworks like Seaside
    ●
        ...
Pure OOP?

●   What does a language like C++ do in non object-
    oriented ways?
    ●   Primitive data types like int, char, float...
    ●   Control flow like if, while, for
    ●   Functions
    ●   Function names
    ●   Classes (while they can create objects, they are not
        objects).
    ●   The call stack
    ●   Processes/threads
    ●   ...etc
Secrets of the classes
●   How was the class MyLoop created?
      Object subclass: #MyLoop
        instanceVariableNames: ''
        classVariableNames: ''
        poolDictionaries: ''
        classInstanceVariableNames: ''
●   Can we do this manually?
Classes are objects

        MessageBox notify: 12 class printString
        Console.WriteLine("{0}",12.GetType( ).ToString( ))
        System.out.println(myObj.getClass( ))
●   Reflection: The program can ask for information
    about its own classes, methods, fields...etc
●   Useful for metaprogramming, many applications
    ●   Automatic serialization
    ●   Generation of GUI
    ●   Factories
    ●   ...etc
Classes are objects

●   Classes are defined, modified at runtime
●   Everything happens at runtime! No compile
    time/runtime distinction.
    ●   But methods are compiled, into bytecode or JITed
●   It's like Photoshop + Interpreter
●   The IDE and application are one!
    ●   e.g Debugging
    ●   e.g Inspector
    ●   Inspect & debug IDE!
Applications: Smalltalk
●   Education
    ●   eToys
    ●   OpenCroquet
●   Tools
    ●   The Seaside web framework
    ●   Aida/Web web framework
●   Commercial applications
    ●   Auctomatic
    ●   DabbleDB
    ●   Teleplace
Applications: Ideas
●   Applying the concept to non-smalltalk applications:
    ●   The web, social networks, ...etc are live applications
        that grow without stopping
    ●   The web-browser itself as a live environment
    ●   A new generation of IDEs
    ●   Creative tools with a programming aspect
●   Real tools influenced by Smalltalk:
    ●   Objective-C (iPhone, iPad, Mac applications)
    ●   Java/ .net
    ●   Eclipse
    ●   Firefox 6.0 Scratchpad (demo)

More Related Content

What's hot

Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Connex
Β 
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Java generics past, present and future - Raoul-Gabriel Urma, Richard WarburtonJava generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
JAXLondon_Conference
Β 

What's hot (18)

C# basics
 C# basics C# basics
C# basics
Β 
Constructors and destructors
Constructors and destructorsConstructors and destructors
Constructors and destructors
Β 
Typescript
TypescriptTypescript
Typescript
Β 
iOS Basic
iOS BasiciOS Basic
iOS Basic
Β 
Presentation 4th
Presentation 4thPresentation 4th
Presentation 4th
Β 
Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)Classroom Object Oriented Language (COOL)
Classroom Object Oriented Language (COOL)
Β 
Being Expressive in Code
Being Expressive in CodeBeing Expressive in Code
Being Expressive in Code
Β 
Typescript Basics
Typescript BasicsTypescript Basics
Typescript Basics
Β 
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Java generics past, present and future - Raoul-Gabriel Urma, Richard WarburtonJava generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Java generics past, present and future - Raoul-Gabriel Urma, Richard Warburton
Β 
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017Introduction to kotlin for android app development   gdg ahmedabad dev fest 2017
Introduction to kotlin for android app development gdg ahmedabad dev fest 2017
Β 
Groovy Programming Language
Groovy Programming LanguageGroovy Programming Language
Groovy Programming Language
Β 
NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)NDK Primer (AnDevCon Boston 2014)
NDK Primer (AnDevCon Boston 2014)
Β 
Objective-C for iOS Application Development
Objective-C for iOS Application DevelopmentObjective-C for iOS Application Development
Objective-C for iOS Application Development
Β 
A Deeper look into Javascript Basics
A Deeper look into Javascript BasicsA Deeper look into Javascript Basics
A Deeper look into Javascript Basics
Β 
Objective c
Objective cObjective c
Objective c
Β 
C++ basic
C++ basicC++ basic
C++ basic
Β 
L2 datatypes and variables
L2 datatypes and variablesL2 datatypes and variables
L2 datatypes and variables
Β 
Ballerina philosophy
Ballerina philosophy Ballerina philosophy
Ballerina philosophy
Β 

Similar to Smalltalk, the dynamic language

Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
HaythamBarakeh1
Β 

Similar to Smalltalk, the dynamic language (20)

Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!Ruxmon.2013-08.-.CodeBro!
Ruxmon.2013-08.-.CodeBro!
Β 
Core Java Tutorial
Core Java TutorialCore Java Tutorial
Core Java Tutorial
Β 
Developer’s viewpoint on swift programming language
Developer’s viewpoint on swift programming languageDeveloper’s viewpoint on swift programming language
Developer’s viewpoint on swift programming language
Β 
Functional programming in Scala
Functional programming in ScalaFunctional programming in Scala
Functional programming in Scala
Β 
Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016Not Your Fathers C - C Application Development In 2016
Not Your Fathers C - C Application Development In 2016
Β 
Lightning talk: Kotlin
Lightning talk: KotlinLightning talk: Kotlin
Lightning talk: Kotlin
Β 
Basics of JavaScript
Basics of JavaScriptBasics of JavaScript
Basics of JavaScript
Β 
Unit 1
Unit 1Unit 1
Unit 1
Β 
Start with swift
Start with swiftStart with swift
Start with swift
Β 
Twins: OOP and FP
Twins: OOP and FPTwins: OOP and FP
Twins: OOP and FP
Β 
Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?Ruby is dying. What languages are cool now?
Ruby is dying. What languages are cool now?
Β 
New c sharp4_features_part_v
New c sharp4_features_part_vNew c sharp4_features_part_v
New c sharp4_features_part_v
Β 
Post-graduate course: Object technology: Implementation of object-oriented pr...
Post-graduate course: Object technology: Implementation of object-oriented pr...Post-graduate course: Object technology: Implementation of object-oriented pr...
Post-graduate course: Object technology: Implementation of object-oriented pr...
Β 
Blueprints: Introduction to Python programming
Blueprints: Introduction to Python programmingBlueprints: Introduction to Python programming
Blueprints: Introduction to Python programming
Β 
JavaScript for real men
JavaScript for real menJavaScript for real men
JavaScript for real men
Β 
Introduction to f#
Introduction to f#Introduction to f#
Introduction to f#
Β 
Understanding Implicits in Scala
Understanding Implicits in ScalaUnderstanding Implicits in Scala
Understanding Implicits in Scala
Β 
I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?I know Java, why should I consider Clojure?
I know Java, why should I consider Clojure?
Β 
HelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript DevelopersHelsinkiJS - Clojurescript for Javascript Developers
HelsinkiJS - Clojurescript for Javascript Developers
Β 
Python_Introduction&DataType.pptx
Python_Introduction&DataType.pptxPython_Introduction&DataType.pptx
Python_Introduction&DataType.pptx
Β 

More from mohamedsamyali

More from mohamedsamyali (11)

Computational thinking in Egypt
Computational thinking in EgyptComputational thinking in Egypt
Computational thinking in Egypt
Β 
C++ syntax summary
C++ syntax summaryC++ syntax summary
C++ syntax summary
Β 
C# Summer course - Lecture 3
C# Summer course - Lecture 3C# Summer course - Lecture 3
C# Summer course - Lecture 3
Β 
C# Summer course - Lecture 2
C# Summer course - Lecture 2C# Summer course - Lecture 2
C# Summer course - Lecture 2
Β 
C# Summer course - Lecture 1
C# Summer course - Lecture 1C# Summer course - Lecture 1
C# Summer course - Lecture 1
Β 
C# Summer course - Lecture 4
C# Summer course - Lecture 4C# Summer course - Lecture 4
C# Summer course - Lecture 4
Β 
Computer science department - a four page presentation
Computer science department - a four page presentationComputer science department - a four page presentation
Computer science department - a four page presentation
Β 
Presentation skills for Graduation projects
Presentation skills for Graduation projectsPresentation skills for Graduation projects
Presentation skills for Graduation projects
Β 
Erlang session1
Erlang session1Erlang session1
Erlang session1
Β 
Erlang session2
Erlang session2Erlang session2
Erlang session2
Β 
Themes for graduation projects 2010
Themes for graduation projects   2010Themes for graduation projects   2010
Themes for graduation projects 2010
Β 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
Β 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
Β 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
Β 

Recently uploaded (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
Β 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
Β 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
Β 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
Β 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Β 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
Β 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Β 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Β 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
Β 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
Β 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
Β 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
Β 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
Β 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
Β 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
Β 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
Β 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
Β 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Β 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Β 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Β 

Smalltalk, the dynamic language

  • 1. Smalltalk The dynamic language Mohamed Samy August 2011 samy2004@gmail.com
  • 2. The Dynabook project - 1968 ● Presented in the paper "A Personal Computer for children of all ages" by Alan C. Kay
  • 9. Smalltalk ● One of the first OOP languages, greatly influenced OOP ● Ideas transferred to C++, Objective-C, Java, C#, Ruby, Python, Dylan, ...etc...etc ● Has intellectual 'children' like Self, which in turn influenced IO, JavaScript, and Newspeak ● Commercial implementations: ● VisualWorks, Dolphin Smalltalk, VA Smalltalk ● Open source implementations ● Squeak, Pharo, GNU Smalltalk
  • 10. Pure OOP? ● What does a language like C++ do in non object- oriented ways? ● Primitive data types like int, char, float... ● Control flow like if, while, for ● Functions ● Function names ● Classes (while they can create objects, they are not objects). ● The call stack ● Processes/threads ● ...etc
  • 11. Small syntax ● Assignment: a := 5 ● Message sends: obj message obj messageWithArg: 12 obj messageWithArgA: 12 argB: 13 obj1 + obj2 / obj3 ● Note that 1 + 3 * 5 evaluates to 20, since + , * are message sends like any other.
  • 12. Small syntax ● Messages on top of messages: 2 squared factorial ● Message cascading: window := ShellView new show. window position: 80@80; extent: 320@90; backcolor: Color blue; caption: 'Test Window'.
  • 13. Small syntax ● Blocks myFunc := [ MessageBox notify: 'I have arrived mommy' ] myfunc value ● Blocks with args myFunc := [ :x | MessageBox notify: 'I have arrived ' , x] myFunc value: 'Tamer' myFunc := [ :x :y | x + y ] myFunc value: 12 value: 13
  • 14. Pure OOP? ● What does a language like C++ do in non object- oriented ways? ● Primitive data types like int, char, float... ● Control flow like if, while, for ● Functions ● Function names ● Classes (while they can create objects, they are not objects). ● The call stack ● Processes/threads ● ...etc
  • 15. Primitive types ● Integers, floats, fractions, booleans...etc are all objects ● They even have a class hierarchy ^ ^ ● The hierarchy allows e.g switching between different integral types during program execution, making use of the dynamic typing nature of the language. ● Consider 5 factorial class 100 factorial class
  • 16. Control flow ● If ● cond ifTrue: [block] ● cond ifTrue: [block1] ifFalse: [block2] ● While/Until ● [cond] whileTrue: [block] ● [cond] whileFalse: [cond] ● Counting ● 5 timesRepeat: [ MessageBox notify: 'hi' ] ● 1 to: 10 do: [ :a | MessageBox notify: a printString ] ● 1 to: 10 by: 2 do: [ :a | MessageBox notify: a printString ]
  • 17. Let's create a 'whileNot' loop ● 1- Create a class MyLoop and define this method: whileNot: cond do: action cond value ifFalse: [action value. self whileNot: cond do: action ] ● 2- Let's test our method loop = MyLoop new. i:=0. loop whileNot: [ i=10] do : [i:= i+1]. MessageBox notify: i printString
  • 18. Symbols ● An expression like #abc represents an object ● Symbols guarantee that the same #... expression always returns the same object ● This guarantee makes comparing symbols very fast (compare references instead of strings) ● Class names, message selectors, ...etc are symbols ● The benefits of this are related to the dynamic nature of the language, and will appear shortly
  • 19. Pure OOP? ● What does a language like C++ do in non object- oriented ways? ● Primitive data types like int, char, float... ● Control flow like if, while, for ● Functions ● Function names ● Classes (while they can create objects, they are not objects). ● The call stack ● Processes/threads ● ...etc
  • 20. Processes & Continuations clockStep := [Processor sleep: 1000. (View desktop canvas) font: (Font name: 'Arial' pointSize: 36) beBold; text: Time now printString at: 10@10; free ] digitalClockProcess := [ clockStep repeat ] fork.
  • 21. Processes & Continuations ● A process is an object and, like any other, can be sent messages. ● It knows about its call stack, Smalltalk has support for continuations ● This has a lot of uses... ● Debugging ● Distributed computing ● Continuation-based web frameworks like Seaside ● ...
  • 22. Pure OOP? ● What does a language like C++ do in non object- oriented ways? ● Primitive data types like int, char, float... ● Control flow like if, while, for ● Functions ● Function names ● Classes (while they can create objects, they are not objects). ● The call stack ● Processes/threads ● ...etc
  • 23. Secrets of the classes ● How was the class MyLoop created? Object subclass: #MyLoop instanceVariableNames: '' classVariableNames: '' poolDictionaries: '' classInstanceVariableNames: '' ● Can we do this manually?
  • 24. Classes are objects MessageBox notify: 12 class printString Console.WriteLine("{0}",12.GetType( ).ToString( )) System.out.println(myObj.getClass( )) ● Reflection: The program can ask for information about its own classes, methods, fields...etc ● Useful for metaprogramming, many applications ● Automatic serialization ● Generation of GUI ● Factories ● ...etc
  • 25. Classes are objects ● Classes are defined, modified at runtime ● Everything happens at runtime! No compile time/runtime distinction. ● But methods are compiled, into bytecode or JITed ● It's like Photoshop + Interpreter ● The IDE and application are one! ● e.g Debugging ● e.g Inspector ● Inspect & debug IDE!
  • 26. Applications: Smalltalk ● Education ● eToys ● OpenCroquet ● Tools ● The Seaside web framework ● Aida/Web web framework ● Commercial applications ● Auctomatic ● DabbleDB ● Teleplace
  • 27. Applications: Ideas ● Applying the concept to non-smalltalk applications: ● The web, social networks, ...etc are live applications that grow without stopping ● The web-browser itself as a live environment ● A new generation of IDEs ● Creative tools with a programming aspect ● Real tools influenced by Smalltalk: ● Objective-C (iPhone, iPad, Mac applications) ● Java/ .net ● Eclipse ● Firefox 6.0 Scratchpad (demo)