Presentation is loading. Please wait.

Presentation is loading. Please wait.

Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation.

Similar presentations


Presentation on theme: "Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation."— Presentation transcript:

1 Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation

2 Smalltalk Smalltalk is … –a computer language –a development environment –a philosophy of development –100% objects

3 Where did it come from Conceived in the late 1960’s by Alan Kay Ideas from Simula, Logo, SketchPad Concept of communicating “cells” from his biology background “Cells” later became “Objects” Alan Kay Moved to Xerox Park in 1972 where he w orked on Smalltalk as a language for teaching children

4 Alan Kay Developed a number of concepts in the 60’s and 70’s –Objects –GUI interfaces –LapTop Computer –Smalltalk Alan Kay is now a “Disney Fellow” doing general Research

5 Smalltalk Yesterday & Today First commercial use –Tektronix, embedded in oscilloscopes Used in many areas today –U.S. Power and Light utilities –Insurance Industry –Volkswagen production line –Swiss banks –Ford, General Motors, Chrysler (Xtreme Programming) –Active Web Sites

6 Implementations VisualWorks (CINCOM) –Based on Xerox Park work –Binary cross-platform (UNIX, Linux, Windows, Mac) –Full NC version at www.cincom.com ObjectStudio (CINCOM) –Windows & Mainframes IBM VisualAge Smalltalk –Cross-platform via source (UNIX, Windows, OS/2)

7 Implementations (2) Gemstone/S (Gemstone) –server side, persistent, multi-user, active ODBMS (Unix, Linux, Windows) –NC versions available at www.gemstone.com Dolphin –was free now commercial Squeak –Free - small group started by Alan Kay –Available at www.squeak.org MT –compiled, windows-only GNU –command line, no GUI

8 Smalltalk – What Is It A pure object language Simple syntax (5 lines of BNF) No compile-time types –Object’s have types –Variables / parameters do not Syntax contains no conditionals Syntax contains no loops Automatic Garbage Collection

9 Smalltalk – What is it (2) Uses a VM Compiles to byte codes Byte codes can be interpreted Normal execution uses a “cached compile” technique pioneered by Smalltalk in the 1980’s. Debugging uses interpreter

10 The Language Data is encapsulated in objects Access via sending message to the object A message invokes a method All method returns a value (default the object) Everything is an object –Integer, Float, Character, String –Class, Method, Byte Codes –Other Objects

11 Classes, Variables, Objects A class is a pattern for an object –Defines instance variables –Defines methods –May inherit from another class An Object is instantiated from a class using “Class new” Two kinds of variables –Instance variables in the object –Temporary variables in the method

12 Methods and Messages Three kinds of messages –Unary (name of method) person surname –Keyword (name and parameters) person surname: ‘Jones’ –Binary, any single or pair of special characters personA = personB stringA, stringB age + 4 age + 4 * 2

13 Constant Values Constants –Integers 2, 248 –Characters $A $+ $$ –Strings ‘this is a string’ –Floats 123.45 –Fixed Decimal (some) 123.45s –Symbols (canonicalized strings) #abc #surname –Arrays #(12 ‘string’) Comments –“this is a comment”

14 Arithmetic This slide should be empty, there is no such concept However, by convention, if you send the message “+” to a numeric value the result is likely the sum Note however that “+” could be defined for String, Person etc. Note “3 + 4 * 5” results in 35!!

15 Conditionals Code block (its an object) [statements] [:parm | statements] Conditional aBoolean ifTrue: […] aBoolean ifTrue: […] ifFalse: […] (true) ifTrue: aBlock aBlock value (false) ifTrue: aBlock “do nothing”

16 Collections Many types of collections –Array (fixed size) –OrderedCollection (variable size) –Dictionary (keyed values) Simple enumerator aCollection do: [:obj | …] Other enumerators select:block returns boolean reject:block returns boolean collect:block returns new values

17 Sample Code (PersonHolder) firstPerson | person | person := self getPerson. spouse := person spouse. spouse > person ifTrue: [^spouse]. ^person (Person) > aPerson ^self age > aPerson age

18 Sample Code (2) Find all persons older than some other person: allOlderThan: aPerson ^personList select: [:p | p > aPerson]

19 Why Smalltalk Its fast Its easy to work and think with Changes are instantly available Debugger is fully interactive Its fully reflective, classes, methods, byte codes, compiler all written in Smalltalk Automatic garbage collection

20 Why Smalltalk (2) Features –IDE uses single browser (written in Smalltalk of course) –Fully integrated GUI development –Image reading (gif, bmp) and manipulation (grow, shrink, rotate, flip, …) –Network Support (SMTP, POP, IMAO, SOAP, SSP (JSP), …)

21 What We do at Cherniak Software Tools and Framework for building end-user database applications –Accounting –Payroll –Custom VisualWorks and Gemstone Business and Framework code runs both on VW and on Gemstone


Download ppt "Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation."

Similar presentations


Ads by Google