SlideShare una empresa de Scribd logo
1 de 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)

Más contenido relacionado

La actualidad más candente

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
 

La actualidad más candente (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 a Smalltalk, the dynamic language

Similar a 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
 

Más de mohamedsamyali

Más de 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
 

Último

+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@
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
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
 

Último (20)

From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
+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...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
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
 
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
 
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
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 

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)