Pharo is an open-source live-programming environment and programming language started in 2008. The official web site is http://www.pharo-project.org. By providing a stable and small core system, excellent dev tools, and maintained releases, Pharo is an attractive platform to build and deploy mission-critical applications.
1. Pharo:
A malleable and powerful
platform
Damien Cassou and Camille Teruel
http://www.pharo.org
2. What is it?
Programming language + IDE
Object-Oriented, Dynamic, Reflective
Explore + Change running systems
The Ultimate Live Programming
Environment!
3. Pharo
MIT license
Great community of active doers
Powerful
Elegant and fun to program
Living system under your fingers
Mac, Linux, Android, iOS, Windows
4. 2nd most downloaded on Inria gforge
40-50 active commiters
> 600 mailing-list members
180 license agreements
50 association members
17 industrial consortium members
around 300 external projects
Pharo in numbers
Very High
Activity
10. No constructors, no static methods, no operators
No interfaces, no private/protected modifiers
No type declarations, no parametrized types
No primitive types, no boxing/unboxing
Still powerful
12. 213 class
SmallInteger
Objects are instances of
Classes
class is a message sent
to the object 213
SmallInteger is the
result of the message sent
In “Java”:
213.getClass()
16. Classes are objects too
Number allSubclasses
an OrderedCollection(Fraction Float Integer
ScaledDecimal SmallInteger LargePositiveInteger
LargeNegativeInteger)
26. Point class
Point class
Classes are objects too
“Point class” is an anonymous class
with only one instance: Point.
We call such classes “metaclasses”
30. Class extensions
A method can be defined in a class that
belongs to another package!
Powerful to build DSLs
$x ctrl , $f ctrl
Ctrl + X , Ctrl + F
ctrl method in
Character class
31. Summary
Everything is an object
One single model
Classes are objects too
A class is instance of another class
One unique method lookup, look in the
class of the receiver
34. Syntax on a PostCard
exampleWithNumber: x
|y|
true & false not & (nil isNil)
ifFalse: [ self halt ].
y := self size + super size.
{ 1 . 2 . #($a #a ‘a’ 1 1.0) }
do: [ :each |
Transcript
show: (each class name);
show: (each printString);
show: ‘ ‘ ].
^ x < y
35. Language Constructs
^ return
“
comments
# symbol or array
‘
string
[] block
. separator
; cascade
| local or block variable
:= assignment
$ character
<...> annotation
51. A method definition in Point
Method name
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
52. A method definition in Point
Argument
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
53. A method definition in Point
Comment
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
54. A method definition in Point
Return
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
55. A method definition in Point
Instance variable
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
56. A method definition in Point
Binary message
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
57. A method definition in Point
Keyword message
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
58. A method definition in Point
Block
<= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
(2@3) <= (5@6)
true
59. Point>> <= aPoint
"Answer whether the receiver is neither
below nor to the right of aPoint."
^ x <= aPoint x and: [y <= aPoint y]
in books and slides, we
specify the class name
Class name
60. Statements and Cascades
Temporary variables Statement
Cascade
| p pen |
p := 100@100.
pen := Pen new.
pen
up;
goto: p;
down;
goto: p+p
61. Anonymous method
Passed as method argument or stored
f := [:x | x * x + 3].
f value: 2
7
Blocks (aka Closure)
BlockClosure>>value:
80. Serializing Continuations
[ "some code causing an error" ]
on: Error
do: [ :error |
FLSerializer
serialize: error
toFileNamed: 'error.fuel' ]
Then in a new image open a debugger on the serialized error:
FLMaterializer
materializeFromFileNamed: 'error.fuel';
debug.
81. Powerful Breakpoints?
Would be so good if we could say:
“Stop method bar only if it is called from
method named foo” i.e.,
bar
...
Halt whenCalledFrom: #foo.
...
88. Continuous API Testing
keep your services under control 24/7
Norbert Hartl norbert@2denker.de
www.2denker.de
89. WEBDRUCK.CH
Web-To-Print Solution
• Design and create
individual printed
matter
• eShop with credit
card payment
• High quality PDF
output with Printing
Process integration
• Thousands of orders
for seven Swiss
printing companies
98. University of Bueno Aires
University of Bern scg.unibe.ch
University of Brussels soft.vub.ac.be/soft/
Ecole des Mines www.ensm-douai.fr
Université de Savoie www.imus.univ-savoie.fr
Ivan Franko National University of Ukraine
Czech Technical University
University of Life Sciences in Prague
Northen Michigan University www.nmu.edu
University Catholic of Argentina www.uca.edu.ar
University of Santiago www.uchile.cl
Universitat Policnica de Catalunya www.upc.edu
Lectures
99. Lafhis (University of Bueno Aires )
Software Composition Group (scg.unibe.ch)
CAR (Ecole des mines www.ensm-douai.fr)
RMoD (Inria)
Ummisco (IRD)
Reveal (University of Lugano)
Lysic (University of Bretagne Occidentale)
Pleiad (University of Santiago)
CEA-List
Research Groups
100. Community Ongoing Work
Better widgets, UI Builder (A. Plantec, G. Chambers, B. van Ryseghem)
Better browsers (B. van Ryseghem, C. Bruni)
Proxy (M. Martinez-Peck)
New compiler (J. Ressia/M. Denker/C. Bera/)
Vectorial canvas (I. Stasenko)
Better FFI (I. Stasenko, E. Lorenzano)
Bootstrap (G. Polito/S. Ducasse/N. Bouraqadi/L. Fabresse)
PDF generation (O. Auverlot, G. Larcheveque)
Network (WebSocket, Oauth, Zinc, Zodiac S. van Caekenberghe)
103. Consortium Members
Managed by Inria for now
Who: companies, institutions, user groups
Privileged access to the core development team
Influence priorities of the next development
Engineering support time
Job posts
Training/Conferences special prices
104.
105. Pharo User Association
Managed by the Pharo Association
Individuals
Premium (99 €/year)
Normal (40 €/year)
Join and participate!
106. Pharo books
Pharo by example
translated to french, merci!
translated to spanish, gracias!
translated to japanese, ありがとう!
german started
http://pharobyexample.org
107. New books are coming
Deep into Pharo
Pharo for the Enterprise
A glimpse at VM
108. Everybody can help
Reporting bugs
Confirming bugs
Writing tests
Writing examples
Writing comments
Simple contributing fixes
Discussion, feedback
109. May 2008 Bern
July 2009 Bern
October 2009 Lille
November 2009 Buenos Aires
March 2010 Bern
May 2010 Buenos Aires
June 2010 Bern
June 2010 Bruxelles
July 2010 London
September 2010 Barcelona
September 2010 Lille
January 2011 Lille
July 2011 Lille
October 2011 Bruxelles
February 2012 Bern
October 2012 Bern
April 2012 Lille
August 2012 Ghent
October 2012 Perto Madryn
January 2013 Santiago
February 2013 Lille
April 2013 Lille
June 2013 Lille
Open Pharo Sprints
110. To Take Away
Because it is simple and extensible, Pharo is a nice
platform to experiment on
Use it for your own research (language design or
implementation, types, modularity, empirical studies…)
http://www.pharo.org