29
Squeak by Example A. Black, S. Ducasse, O. Nierstrasz, Damien Pollet www.squeakbyexample.org

Squeak by Example - Fosdem08

Embed Size (px)

DESCRIPTION

Lightning talk (20 min) I gave at Fosdem in february 2008 in Brussels, to announce Squeak by Example and make a little noise around Smalltalk. Resources… - http://www.SqueakByExample.org - Alto pictures from http://ftp.squeak.org/Media/ - the font is Jan Gerner's Yanone Kaffeesatz: http://fonts.info/info/en_yanone-kaffeesatz.htm

Citation preview

Page 1: Squeak by Example - Fosdem08

Squeakby Example

A. Black, S. Ducasse, O. Nierstrasz,Damien Pollet

www.squeakbyexample.org

Page 2: Squeak by Example - Fosdem08
Page 3: Squeak by Example - Fosdem08

“I invented the termObject-Oriented,and I can tell you

I did not have C++ in mind.”

— Alan Kay

Page 4: Squeak by Example - Fosdem08

Everything isan Object

Page 5: Squeak by Example - Fosdem08

Objects livein an image

Page 6: Squeak by Example - Fosdem08

shot with debugger, explorer,workspace

Page 7: Squeak by Example - Fosdem08

example: aNumber"This is a method that illustrates every part of the Smalltalk method syntax. It has unary, binary, and keyword messages, declares arguments and temporaries, accesses an instance variable and a global variable, uses literals (array, character, symbol, string, integer, float), uses the pseudo variables true, false, nil, self, and super, and has sequence, assignment, return and cascade. It has both zero argument and one argument blocks. It doesn’t do anything useful, though."

| x |true & false not & (nil isNil) ifFalse: [ self halt ].x := y + super size.#( $a #a 'a' 1 1.0 ) do: [ :each |

Transcriptshow: each class name ;show: each printString ].

^ x < aNumber

Page 8: Squeak by Example - Fosdem08

Method invocationis late bound

Page 9: Squeak by Example - Fosdem08

Methodsare public

Page 10: Squeak by Example - Fosdem08

Instance variablesare private

Page 11: Squeak by Example - Fosdem08

Single inheritance

Page 12: Squeak by Example - Fosdem08

Garbage collection

Page 13: Squeak by Example - Fosdem08

Everything iswritten in Smalltalk

Page 14: Squeak by Example - Fosdem08

Control structuresare just methods

Page 15: Squeak by Example - Fosdem08

do: aBlock 1 to: self size do: [:index | aBlock value: (self at: index)]

Page 16: Squeak by Example - Fosdem08

Java for-each (JSR 201)dec. 2002 – sep. 2004

Page 17: Squeak by Example - Fosdem08

What you need

VM Image

Sources Changes

Page 18: Squeak by Example - Fosdem08

What you get

Page 19: Squeak by Example - Fosdem08
Page 20: Squeak by Example - Fosdem08

3.10 image soonbetter tools

modularizationgreen unit tests

Page 21: Squeak by Example - Fosdem08
Page 22: Squeak by Example - Fosdem08

the heretic web framework

✓interactive web applications✓backtracking✓components

– REST and pretty URLs for free– templates

Page 23: Squeak by Example - Fosdem08

renderContentOn: html html heading: count. html anchor callback: [ self increase ]; with: '++'. html space. html anchor callback: [ self decrease ]; with: '--'

Page 24: Squeak by Example - Fosdem08
Page 25: Squeak by Example - Fosdem08

2.8 releasefasterlighter

supported by major Smalltalk vendors: Cincom, Gemstone

Page 26: Squeak by Example - Fosdem08

GNU Smalltalk

Page 27: Squeak by Example - Fosdem08
Page 28: Squeak by Example - Fosdem08

3.0.1 released last monthnew syntax for classes*.star package format

Seaside ported as of last night :-)

Page 29: Squeak by Example - Fosdem08

getting startedquick tourfirst applicationsyntaxmessages

programmingobjectstoolstestingbasic classes

collectionsstreamsGUImetaclasses

get the PDF or buy the booktry Smalltalk and have fun!

www.squeakbyexample.org

www.squeak.org#squeak on freenode

www.seaside.stsmalltalk.gnu.org