isLoop 2025 Program
Guided Exercises
- A first tutorial: Developing a simple counter
- Die: Crafting a simple embedded DSL with Pharo
- Rock Paper Scissors
- A little Saturn PathFinder + an extra part: Finding the North with Compass
- Country Flag
- A memory game: A simple tutorial with Bloc
- A little expression interpreter
- Understanding Visitors
Day 1: Introduction to Pharo and OOP
During this day, you will learn the survival kit to code in Pharo. You will learn the syntax and the main tools to code and publish code. After that day you will be able to code in Pharo. You will also learn the simple object model of Pharo, understand what are objects and classes, learn the difference between messages and methods, learn to create packages, classes and methods in System Browser.
1. Welcome
- Welcome words
- What is Pharo? [slides] [video EN] [video FR]
- Install Pharo [download]
- First look and Hello World in Pharo environment
- First look at the environment: Playground, Inspector, System Browser, Debugger
2. ProfStef Tutorial
Open the Playground and evaluate the following line: ProfStef go.
4. Objects and Classes
5. Exercise: Counter
[PDF] In this exercise you will learn how to create packages, classes, methods, instances, unit tests and more. This tutorial covers most of the important actions you will perform when developing in Pharo.
Recommended videos
Day 2: Inheritance, Method Lookup, and Dispatch
You will learn about inheritance and polymorphism - the key concepts in object-oriented programming. You will understand why sending a message is making a choice based on classes. You will also understand what is to send a message and how lookup works.
1. Exercise: Counter
Finish the exercise.
2. Kata: Rock-Paper-Scissors (if-else)
This exercise consists of implementing the rock paper scissor game. For this, you will need to have a class named RockPaperScissors
. For playing the game, the user needs to use the class like this:
game := RockPaperScissors new.
result := game play: #paper against: #rock.
result "#paper"
3. Inheritance and Method Lookup
4. Kata: Rock-Paper-Scissors (double dispatch)
[PDF] In this exercise, you have to implement the Rock-Paper-Scissors game using a simple but powerful approach called double dispatch that consists of sending another message to the argument hence making two choices one after the other. This exercise will show you an important paradigmatic shift where you will go from asking questions (conditionals) to sending orders. It is a clear illustration of the "Don’t ask, Tell" design principle.
Recommended videos
- Essence of Dispatch: Let the receiver decide
- A double dispatch starter: Stone Paper Scissors
- Double dispatch: Does not have to be symmetrical
- Stone Paper Scissors: The case of results
- Double Dispatch: Adding numbers as a Kata
Day 3: Messages and Advanced Topics
1. Exercise: Rock-Paper-Scissors
Finish the exercise.
2. Messages
- Understanding messages [slides] [video EN] [video FR]
- Message composition and precedence [slides] [video EN] [video FR]
- Message sequence and cascade messages [slides] [video EN] [video FR]
3. Advanced Topics from Stéphane
- Searching for examples in Finder with regex
- Exploring bytecode and abstract syntax trees (AST)
- Extreme test-driven development: writing code in the debugger
- Test-Driven Development [slides] [video]
- Xtreme Test Driven Development: Getting a productivity boost [slides] [video]
- Deprecation rewriting [paper]
Open Playground write a method signature like this: Collection >> #do:
and inspect it. Navigate through inspector tabs to see the bytecode or the AST.
Recommended videos
- Introduction to blocks
- Parenthesis Vs Square Brackets
- Blocks vs. Objects: Rethinking common abstractions
- Messages for Java programmers
Day 4: Spec, Inspector Extensions & Deeper into Dispatch
1. Exercise: Country Flags
[PDF] In this tutorial, you will learn how to draw a country shape using Roassal (a visualization engine). In a second step, you will use an HTTP client to grab the flag of the country based on its unique international id. You will then define a small visual application using the Spec UI builder and it will display the country, its ID, and flag.2. Understanding super
- About super [slides] [video EN] [video FR]
- Did You Really Understand Super? [slides] [video EN] [video FR]
3. Implementation of True and False in Pharo
Exercise: Implement boolean objects true
and false
(you can call them "t" and "f" or "myTrue" and "myFalse" to make sure that they don't conflict with the existing boolean objects in the image) that understand the following messages: not, and:, or:, ifTrue:, ifFalse:
. You are not allowed to use conditionals (if-else) in your implementation.
Solution: Essence of dispatch: Taking Pharo Booleans as Example
Day 5: Fun Stuff
1. How to Contribute to Pharo
- https://pharo.org/contribute
- Contributing to Pharo - ESUG 2022
- Git: New project creation [video EN] [video FR]
- Git: Creating a remote repository to an existing project [video EN] [video FR]
- Git: Loading a project with Metacello [video EN] [video FR]
- A detailed guide on Baselines
- Setting up your continuous integration via GitHub Actions