Pharo

From Wikipedia, the free encyclopedia
Jump to navigation Jump to search

Pharo
Pharo logo with lighthouse
Paradigmobject-oriented
FamilySmalltalk: Squeak
DeveloperPharo community
First appearedMarch 2008; 18 years ago (2008-03)
Typing disciplinedynamic
Implementation languageSmalltalk
PlatformARM, IA-32, x86-64
OSWindows, Linux, macOS, others
LicenseMIT, partly Apache 2.0[1]
Websitepharo.org
Influenced by
Smalltalk (Squeak)

Pharo is a cross-platform implementation of the classic Smalltalk-80 programming language and runtime system.[2] It is based on the OpenSmalltalk virtual machine (VM) named Cog,[3][4][5][6]: 16  which evaluates a dynamic, reflective, and object-oriented programming language with a syntax closely resembling Smalltalk-80. It is free and open-source software, released under a mix of MIT, and Apache 2 licenses.

Pharo is shipped with source code compiled into a system image that contains all software needed to run Pharo.[6]: 16  Like the original Smalltalk-80, Pharo provides several live programming features such as immediate object manipulation, live updates, and just-in-time compilation (JIT). The system image includes an integrated development environment (IDE) to modify its components.

Pharo was forked from Squeak v3.9 in March 2008.[7][2][6][6]: 10 [8]

Overview

[edit | edit source]

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" (French pronunciation: [faʁ]) which means lighthouse. This is why the Pharo logo shows a drawing of a lighthouse inside the final letter O of the name.

Key features

[edit | edit source]

Virtual machine

[edit | edit source]
  • Multiplatform virtual machine with just-in-time compilation (JIT), combined generational garbage collector, ephemerons, forwarders
  • Fast object enumeration
  • Easy call stack manipulation
  • AST metalinks
  • Relatively low memory consumption
  • Customizable compiler
  • Optional complete object memory persistence
  • Resumable exceptions
  • Fast object serialization

Built-in software

[edit | edit source]

Language features

[edit | edit source]
  • 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

[edit | edit source]

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.[how?]

Language syntax

[edit | edit source]
Pharo syntax postcard

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. The expressions that specify the array content are evaluated during program execution
{1. 2. 1+2}
  • literals for byte arrays that can be composed only of integer numbers in the range from 0 to 255
#[1 2 3 4]
  • 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
<gtInspectorPresentationOrder: 30>
  • 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 uses Tonel as the preferred code serializing format.

History

[edit | edit source]

Pharo emerged as a fork of Squeak, an open-source Smalltalk environment created by the original Smalltalk-80 team (Dan Ingalls and Alan Kay). Pharo was created by S. Ducasse [1] and M. Denker in March 2008. It focuses on modern software engineering and development techniques.[citation needed] Pharo is supported by the Pharo consortium (for legal entities) [2] and the Pharo association for physical persons [3].

Pharo version Release date Major features
March 16, 2008[9] Fork of Squeak environment
1.0 April 15, 2010 real closures, EToys and MVC removed
1.1 July 26, 2010 Cog JIT VM, Settings framework
1.2 March 29, 2011 new Finder, Recent changes tool, improved Help, better themes
1.3 August 2011 Zinc, headless images
1.4 April 2012[10] Ring metamodel, better code simulator
2.0 March 18, 2013[11] browser improvements, QA tools, Fuel serializer, better files API
3.0 April 2014[12] new modular compiler (Opal) and debugger, continuations
4.0 April 2015[13] GTools, slots
5.0 May 2016[14] Spur VM, UFFI, improved reflectivity
6.0 6 June 2017[15] 64-bit and Git support
6.1 24 July 2017[16] improved Git support
7.0 22 January 2019[17] bootstrapping, new code browser (Calypso), stateful traits
8.0 20 January 2020[18] improved support of Git, testing, refactoring and Windows
9.0 15 July 2021[19] GTK3 support, object-centric debugger and inspector, refactorings, official ARM VMs
10.0 5 April 2022[20] Cleanups, modularization, many rewritten and improved tools
11.0 11 May 2023[21] Ephemerons, SIMD, more efficient closures, improved tools
12.0 26 May 2024[22] New debug points system, new class definitions, permanent space
Latest version: 13.0 21 May 2025[23] HDPI support, Zoomable UI, New Process Browser, Organic window manager, Async IO using epoll on unixes
Latest version: 13.1 26 June 2025[24] Improvements merged since version 13.0

Use of Pharo

[edit | edit source]

Companies and consultants

[edit | edit source]

Some companies use Pharo for their development projects.[25] In particular, they use:

The Pharo consortium[30] was created for companies wishing to support the Pharo project. The Pharo association[31] was created in 2011[32] for users wishing to support the project.

Performance and virtual machine (VM)

[edit | edit source]

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 has been developed that performs nearly as well as the fastest Smalltalk virtual machine.[33] 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.[34]

See also

[edit | edit source]

Lua error in mw.title.lua at line 392: bad argument #2 to 'title.new' (unrecognized namespace name 'Portal').

References

[edit | edit source]
  1. ^ Pharo license information
  2. ^ a b Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  3. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  4. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  5. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  6. ^ a b c d Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  7. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  8. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  9. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  10. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  11. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  12. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  13. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  14. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  15. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  16. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  17. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  18. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  19. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  20. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  21. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  22. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  23. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  24. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  25. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  26. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  27. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  28. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  29. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  30. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  31. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  32. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  33. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
  34. ^ Lua error in Module:Citation/CS1/Configuration at line 2172: attempt to index field '?' (a nil value).
[edit | edit source]