Pharo is a
cross-platform
Within computing, cross-platform software (also called multi-platform software, platform-agnostic software, or platform-independent software) is computer software that is designed to work in several Computing platform, computing platforms. Some ...
implementation of the classic
Smalltalk
Smalltalk is a purely object oriented programming language (OOP) that was originally created in the 1970s for educational use, specifically for constructionist learning, but later found use in business. It was created at Xerox PARC by Learni ...
-80
programming language
A programming language is a system of notation for writing computer programs.
Programming languages are described in terms of their Syntax (programming languages), syntax (form) and semantics (computer science), semantics (meaning), usually def ...
and
runtime system
In computer programming, a runtime system or runtime environment is a sub-system that exists in the computer where a program is created, as well as in the computers where the program is intended to be run. The name comes from the compile time ...
.
It is based on the
OpenSmalltalk virtual machine
In computing, a virtual machine (VM) is the virtualization or emulator, emulation of a computer system. Virtual machines are based on computer architectures and provide the functionality of a physical computer. Their implementations may involve ...
(VM) named Cog,
which evaluates a dynamic,
reflective, and
object-oriented
Object-oriented programming (OOP) is a programming paradigm based on the concept of '' objects''. Objects can contain data (called fields, attributes or properties) and have actions they can perform (called procedures or methods and impleme ...
programming language with a
syntax
In linguistics, syntax ( ) is the study of how words and morphemes combine to form larger units such as phrases and sentences. Central concerns of syntax include word order, grammatical relations, hierarchical sentence structure (constituenc ...
closely resembling
Smalltalk-80. It is
free and open-source software
Free and open-source software (FOSS) is software available under a license that grants users the right to use, modify, and distribute the software modified or not to everyone free of charge. FOSS is an inclusive umbrella term encompassing free ...
, released under a mix of
MIT
The Massachusetts Institute of Technology (MIT) is a private research university in Cambridge, Massachusetts, United States. Established in 1861, MIT has played a significant role in the development of many areas of modern technology and sc ...
, and
Apache
The Apache ( ) are several Southern Athabaskan language-speaking peoples of the Southwestern United States, Southwest, the Southern Plains and Northern Mexico. They are linguistically related to the Navajo. They migrated from the Athabascan ho ...
2 licenses.
Pharo is shipped with
source code
In computing, source code, or simply code or source, is a plain text computer program written in a programming language. A programmer writes the human readable source code to control the behavior of a computer.
Since a computer, at base, only ...
compiled into a ''system image'' that contains all software needed to run Pharo. Like the original Smalltalk-80, Pharo provides several
live programming features such as immediate object manipulation,
live updates, and
just-in-time compilation
In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is compilation (of computer code) during execution of a program (at run time) rather than before execution. This may consist of source code transl ...
(JIT). The system image includes an
integrated development environment
An integrated development environment (IDE) is a Application software, software application that provides comprehensive facilities for software development. An IDE normally consists of at least a source-code editor, build automation tools, an ...
(IDE) to modify its components.
Pharo was forked from
Squeak
Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imaginee ...
v3.9 in March 2008.
Overview
Pharo is a pure object-oriented, dynamically typed, and reflective language. The stated project goal is to revisit Smalltalk design and enhance it.
The name Pharo comes from the French word "phare" () which means
lighthouse
A lighthouse is a tower, building, or other type of physical structure designed to emit light from a system of lamps and lens (optics), lenses and to serve as a beacon for navigational aid for maritime pilots at sea or on inland waterways.
Ligh ...
. This is why the Pharo logo shows a drawing of a lighthouse inside the final letter ''O'' of the name.
Key features
Virtual machine
* Multiplatform virtual machine with
just-in-time compilation
In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is compilation (of computer code) during execution of a program (at run time) rather than before execution. This may consist of source code transl ...
(JIT), combined generational
garbage collector,
ephemerons, forwarders
* Fast object enumeration
* Easy
call stack
In computer science, a call stack is a Stack (abstract data type), stack data structure that stores information about the active subroutines and block (programming), inline blocks of a computer program. This type of stack is also known as an exe ...
manipulation
* AST metalinks
* Relatively low memory consumption
* Customizable compiler
* Optional complete object memory persistence
* Resumable exceptions
* Fast object serialization
Built-in software
* Optional fusion of developed program and
development environment
*Live object inspection
Language features
* Simple syntax
* Object-oriented programming
* Immediate object identity swapping
* Dynamic inheritance
* Objects as methods
* Optional
Green threads
* Customizable metaclasses
* Easy to use proxy objects
Relation to Smalltalk
Pharo is based on general concepts of Smalltalk but seeks to improve on them, so does not limit itself to them. The basic syntax of the language has a close resemblance to Smalltalk. However, the way
classes are defined in Pharo differs from other Smalltalk
dialects
A dialect is a variety of language spoken by a particular group of people. This may include dominant and standardized varieties as well as vernacular, unwritten, or non-standardized varieties, such as those used in developing countries or iso ...
.
Language syntax

The Pharo syntax is based on
Smalltalk-80 language syntax with several extensions. Some of these are common among modern Smalltalk dialects.
* literals for dynamic
arrays
An array is a systematic arrangement of similar objects, usually in rows and columns.
Things called an array include:
{{TOC right
Music
* In twelve-tone and serial composition, the presentation of simultaneous twelve-tone sets such that the ...
. The expressions that specify the array content are evaluated during program execution
* literals for
byte
The byte is a unit of digital information that most commonly consists of eight bits. Historically, the byte was the number of bits used to encode a single character of text in a computer and for this reason it is the smallest addressable un ...
arrays that can be composed only of integer numbers in the range from 0 to 255
# 2 3 4/syntaxhighlight>
* literals for scaled decimals, a representation of fixed point decimal numbers able to accurately represent decimal fractions
3.14s2
* pragmas. In Smalltalk-80 the pragmas are used only for primitive methods. In Pharo they are fully capable method annotations
* two double quotes inside a comment are interpreted as one double quote character that is part of the content of the comment
The Pharo language syntax is supposed to be very simple and minimalist. The basic language elements are often presented on one postcard as a showcase for the language's brevity. The grammar is classified as LL(1).
The language grammar does not specify directly how the code should be stored in files. Pharo use
Tonel
as the preferred code serializing format.
History
Pharo emerged as a fork of Squeak
Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imaginee ...
, an open-source Smalltalk environment created by the original Smalltalk-80 team (Dan Ingalls
Daniel Henry Holmes Ingalls Jr. (born 1944) is a pioneer of object-oriented computer programming and the principal architect, designer and implementer of five generations of Smalltalk environments. He designed the bytecoded virtual machine that m ...
and Alan Kay
Alan Curtis Kay (born May 17, 1940) published by the Association for Computing Machinery 2012 is an American computer scientist who pioneered work on object-oriented programming and windowing graphical user interface (GUI) design. At Xerox ...
). Pharo was created by S. Ducass
and M. Denker in March 2008. It focuses on modern software engineering and development techniques. Pharo is supported by the Pharo consortium (for legal entities
and the Pharo association for physical person
Use of Pharo
Companies and consultants
Some companies use Pharo for their development projects. In particular, they use:
* Seaside (software), Seaside for dynamic web development
* Zinc for server architectures
* Moose
The moose (: 'moose'; used in North America) or elk (: 'elk' or 'elks'; used in Eurasia) (''Alces alces'') is the world's tallest, largest and heaviest extant species of deer and the only species in the genus ''Alces''. It is also the tal ...
to analyse data and software from all programming languages
* Graphic libraries
A library is a collection of Book, books, and possibly other Document, materials and Media (communication), media, that is accessible for use by its members and members of allied institutions. Libraries provide physical (hard copies) or electron ...
for evolved user interface
In the industrial design field of human–computer interaction, a user interface (UI) is the space where interactions between humans and machines occur. The goal of this interaction is to allow effective operation and control of the machine fro ...
s
* Roassal to visualize data
The Pharo consortium was created for companies wishing to support the Pharo project. The Pharo association was created in 2011 for users wishing to support the project.
Performance and virtual machine (VM)
Pharo relies on a virtual machine that is written almost entirely in Smalltalk. Beginning in 2008, a new virtual machine (Cog) for Squeak, Pharo and Newspeak
In the dystopian novel '' Nineteen Eighty-Four'' (also published as ''1984''), by George Orwell, Newspeak is the fictional language of Oceania, a totalitarian superstate. To meet the ideological requirements of Ingsoc (English Socialism) in O ...
has been developed that performs nearly as well as the fastest Smalltalk virtual machine. In 2014/2015 the VM community is working on Spur, a new Memory Manager for Cog that should again increase performance and provide better 64-bit VM support.
See also
* Amber Smalltalk
* GNU Smalltalk
* Squeak
Squeak is an object-oriented, class-based, and reflective programming language. It was derived from Smalltalk-80 by a group that included some of Smalltalk-80's original developers, initially at Apple Computer, then at Walt Disney Imaginee ...
* VisualWorks
References
External links
*
{{Smalltalk programming language
Programming languages
Object-oriented programming languages
Class-based programming languages
Dynamically typed programming languages
Smalltalk programming language family
Cross-platform free software
Free and open source compilers
Programming languages created in 2008
2008 software
Software using the MIT license
Software using the Apache license
Articles with example Smalltalk code