Squeak and Botkit-Port Jeff Forbes Joel Miller. Introduction ● Squeak is a pure OO language ● Based off of SmallTalk-80 – Designed at Xerox PARC by Alan.

Slides:



Advertisements
Similar presentations
1 Classes and Objects in Java Basics of Classes in Java.
Advertisements

The Web Warrior Guide to Web Design Technologies
10. Smalltalk and Closures Programmierung 2, SS 2007 Adrian Kuhn, PhD candidate Software Composition Group University of Bern.
11. A bit of Smalltalk. © O. Nierstrasz P2 — A bit of Smalltalk 11.2 A bit of Smalltalk Overview  Some history  Smalltalk syntax & object model  The.
CSET4100 – Fall 2009 Perl Introduction Scalar Data, Operators & Control Blocks Acknowledgements: Slides adapted from NYU Computer Science course on UNIX.
Principles of Object-Oriented Software Development The language Smalltalk.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
IST 221 Internet Concepts and Applications Introduction to PHP.
Working with JavaScript. 2 Objectives Introducing JavaScript Inserting JavaScript into a Web Page File Writing Output to the Web Page Working with Variables.
Stéphane Ducasse 1 The Taste of Smalltalk.
13. A bit of Smalltalk. © Oscar Nierstrasz 2 Roadmap  The origins of Smalltalk  What is Smalltalk?  Syntax in a nutshell  Seaside — web development.
PZ06BX Programming Language design and Implementation -4th Edition Copyright©Prentice Hall, PZ06BX - Introduction to Smalltalk Programming Language.
XP 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial 10.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 13 Object-Oriented Programming I am surprised.
JavaScript, Third Edition
Object-oriented programming and design 1 Smalltalk in a Nutshell Objects & classes Messages & methods Inheritance & metaclasses.
Stéphane Ducasse5.1 Smalltalk in a Nutshell OO Model in a Nutshell Syntax in a Nutshell.
12. A bit of Smalltalk. © O. Nierstrasz P2 — A bit of Smalltalk 11.2 Roadmap  Some history  Smalltalk syntax & object model  The Smalltalk environment.
VB .NET Programming Fundamentals
Stéphane Ducasse 1 Smalltalk in a Nutshell.
S.Ducasse Stéphane Ducasse 1 The Taste of Smalltalk.
Introduction to Ruby CSE 413 Autumn 2008 Credit: Dan Grossman, CSE341.
01-Intro-Object-Oriented-Prog-Alice1 Barb Ericson Georgia Institute of Technology Aug 2009 Introduction to Object-Oriented Programming in Alice.
Java Unit 9: Arrays Declaring and Processing Arrays.
Smalltalk Andy Ko Johnvic Dualan Aaron Israel John John Llenteng Jehrom Christian De Vera Carlo Alvarez Michael John Butuyan.
Chapter 6Java: an Introduction to Computer Science & Programming - Walter Savitch 1 l Array Basics l Arrays in Classes and Methods l Programming with Arrays.
Introduction to Java Appendix A. Appendix A: Introduction to Java2 Chapter Objectives To understand the essentials of object-oriented programming in Java.
High-Level Programming Languages: C++
3A-1 1 Introduction to Smalltalk History of Smalltalk The philosophy of Smalltalk:  “...we have a universe of well-behaved objects that courteously ask.
1 Perl Perl basics Perl Elements Arrays and Hashes Control statements Operators OOP in Perl.
1 Python CIS*2450 Advanced Programming Concepts Material for this lecture was developed by Dr. D. Calvert.
University of Houston-Clear Lake Proprietary© 1997 Evolution of Programming Languages Basic cycle of improvement –Experience software difficulties –Theory.
CS 598 Scripting Languages Design and Implementation 7. Smalltalk 80.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
Chapter 6 Object-Oriented Java Script JavaScript, Third Edition.
Smalltalk for Unix & W i n d o w s Dennis Smith Cherniak Software Development Corporation.
Guide to Programming with Python Chapter One Getting Started: The Game Over Program.
1 C++ Syntax and Semantics, and the Program Development Process.
Copyright © 2010 Certification Partners, LLC -- All Rights Reserved Perl Specialist.
Smalltalk (and Squeak) Aida Dungan and Rick Shreve.
ALBERT WAVERING BOBBY SENG. Week 4: JavaScript  Quiz  Announcements/questions.
Chapter 12 Support for Object oriented Programming.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
JavaScript Syntax, how to use it in a HTML document
6.2 For…Next Loops General Form of a For…Next Loop
Introducing Python CS 4320, SPRING Lexical Structure Two aspects of Python syntax may be challenging to Java programmers Indenting ◦Indenting is.
Constructors & Garbage Collection Ch. 9 – Head First Java.
Copyright © 2003 ProsoftTraining. All rights reserved. Perl Fundamentals.
RUBY by Ryan Chase.
Smalltalk Mark Colangelo CMSC-631, Fall December 2002.
Objective You will be able to define the basic concepts of object-oriented programming with emphasis on objects and classes by taking notes, seeing examples,
S.Ducasse Stéphane Ducasse 1 Smalltalk in a Nutshell.
S.Ducasse Stéphane Ducasse savoie.fr e/ e/ 1 Smalltalk in a Nutshell.
CSE 3302 Programming Languages Chengkai Li Fall 2007 Smalltalk Lecture 14 – Smalltalk, Fall CSE3302 Programming Languages, UT-Arlington ©Chengkai.
Announcements Assignment 1 due Wednesday at 11:59PM Quiz 1 on Thursday 1.
M1G Introduction to Programming 2 2. Creating Classes: Game and Player.
JAVA Programming (Session 2) “When you are willing to make sacrifices for a great cause, you will never be alone.” Instructor: รัฐภูมิ เถื่อนถนอม
XP Tutorial 10New Perspectives on HTML, XHTML, and DHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
Introduction to Programming in RobotC
SmallTalk Done By: Nathalie Arzu Erienne Burgess Shanice Joseph.
Aaron Bloomfield CS 415 Fall 2005
Feedback from Assignment 1
Smalltalk – a Pure (and first) OOPL
CS 331 Principles of Programming Languages
Introduction to Smalltalk
Introduction to Smalltalk
CSE 3302 Programming Languages
Compiler Construction
Smalltalk on a Dime.
Presentation transcript:

Squeak and Botkit-Port Jeff Forbes Joel Miller

Introduction ● Squeak is a pure OO language ● Based off of SmallTalk-80 – Designed at Xerox PARC by Alan Kay, Dan Ingalls, Ted Kaehler, and Adele Goldberg – The designers wanted a pure object-oriented, interpreted, easy to use language. – Failed/Abandoned because of the slowness of interpreted languages based on the current technology

Squeak ● Squeak can be obtained at no cost at ● Squeak is self contained and also includes a VM/UI of which all programs are run: – Everything is self contained in an *.image file ● Available for most OSes

The Squeak UI/VM

Squeak Features ● Completely Object Oriented –This means everything is an object! Call by name All code is a message which is sent to an object – An object is an instance of a class – Similar rules to Java ● Garbage collection is standard!

Objects ● Everything is an object ● There are no primitive types ● Even classes are objects!! ● Everything inherits from the Object class ● No dual inheritance, no interfaces ● self is this and super is super

Messages ● 3 Types of Messages: – Unary Ex. ‘abc’ reversed. –Binary ● – Keyword Ex. Transcript show: 5. There can be many keyword messages passed to an object

Syntax ● Assignment x := 13 –In Squeak, the underscore “_” can be used (  ) Arrays: #( ) Character: $e Strings in single quotes Comments in double quotes Equals? = Identity test == Lines are completed with a period # prevents evaluation New creates objects

Order of Operations ● The math inside SmallTalk/Squeak is infinite precision ● Everything left to right – This means * 9 gets evaluated as 63! – 2+(5*9) will get desired result. Messages: Unary > Binary > Keyword

BlockContexts ● Informally called “blocks” ● Used for nearly all structured programming constructs ● Made by putting square brackets around code ● Very similar to lambdas in Scheme

Blocks (cont.) ● [6 + 7] is a block but won't evaluate until you say [6 + 7] value. ● Blocks can have local variables – block := [ :a :b | a + b ] – This would be called as block value: 6 value: 7 ● Blocks introduce pluggability to a class

Conditionals ● The basic conditionals are included: – ifTrue – ifFalse Ex: (x < 15) ifTrue: [ Transcript show: 'less than 15'.] ifFalse: [ Transcript show: 'gt or eq 15'.]

Loops ● whileTrue: – The condition must be a block so it can be re-evaluated ● timesRepeat: – No access to the loop index ● to: do: – First parameter in execute block gets set to index Ex: [x < 15] whileTrue: [ Transcript cr. Transcript show: y. temp := y + z. y := z. z := temp. x := x + 1. ]

BotKit-Port ● BotKit port written by John Purcell ● Written as a masters thesis –Therefore poorly documented ● Directly interfaces with the RCX ● Allows immediate mode and “scripted mode” ● Bug: if statements do not work while sending from the BotKit! (immediate)

Code Examples "simple program which goes foward until communication stops" "From ISpirit initialize. bug := BugBot new. rcx := bug rcx. bug forward. rcx spirit free. "Turn around message: ex. bug turnaround." self rcx soundTrillUp. self forward. self turnLeft; sleep: 200. self backward; sleep: 300. self rcx soundTrillDown.

Examples Cont. "go forward until hit a wall, then backward" ISpirit initialize. bug := BugBot new. rcx := bug rcx. "motor hooked up to port 1 on RCX" theMotor := rcx motor: 1. theMotor on. theSensor := rcx touchSensor: 1. [ theSensor ] whileFalse:[ theMotor forward. ] theMotor backward.

Resources ● Squeak: ● Squeakwiki: ● Squeak: Open Personal Computing and Multimedia by Guzdial and Rose ● BotKit-Port: ● BotKit: arts.com/Bower/Bot-Kit/ (Link Down) Questions?