Planet Smalltalk

May 29, 2016

Torsten Bergmann - Glorp for Pharo

Glorp (the Smalltalk ORM framework) for Pharo was updated

Pharo Weekly - Glorp the Object-Relational mapper

Hello all,

During the first part of the year, and sponsored by the Pharo
Consortium, I started a new port of Glorp, the Object-Relational
mapper, based on the latest version available in VW 8.0.1.

This latest port was done from scratch in Pharo and brings features
and bugfixes that were accumulated in the VW port during more than 5
years (previous Pharo port) and weren't available until now; and it
uses the Garage database drivers (but not limited to them).

During the last couple of months, and also by request of the
Consortium, I wrote a chapter for one of the Pharo books describing
Glorp as much as possible, with tutorials and key concepts. The
chapter ended up being the longest in text and pages of all written;
the domain is so broad and deep that I'm considering taking it to a
whole book, who knows...

The book is available at
and I will welcome suggestions and corrections as pull requests to

The Glorp repository is the same as the previous one
(!/~DBXTalk/Glorp), and the current
Metacello configs will load the previous version for Pharo 4 and the
new version for Pharo 5. For the foreseeable future I'll continue
maintaining Glorp, but the code is MIT and I'm open to contributions
(I'll set up a Github repo in the next days).

Also I've been running production software based on Glorp for a few
years now, so my experience with it cover most of its features and
usage patterns, so if you have particular questions not covered by the
book chapter or any other material feel free to ask me, this mailing
list or to the Glorp mailing list at <>.

Best regards!

Esteban A. Maringolo

Torsten Bergmann - Pharo in use - Sorabito

Marten Feldtmann - Making Gemstone/s sending events to external programs

In all my programming experiences with Gemstone/S I have one problem which is not solved in a very good way: how can external program be informed about changes in the database they are perhaps interested in.

The most common answer to this question is: polling. I do it in all languages PUM is supporting: Python, ExtJS, C# or VASmalltalk. Make a REST request to the database in a periodical time and consume the result.

Ok, I’m now consider changing this in a fundamental way. In the past I used 0MQ several times and with 0MQ I consider making Gemstone/s more active to client programs.

The whole “incoming-request”-“handle resquest”-“commit or abort” cycle I add an additional cycle: “send notification”:

“incoming-request”-“handle request”-“commit or abort”-“send notification”

All topaz scripts (or the HTTP request script) open a PUSH socket to a python script offering an pull-socket. So we have a n:1 socket connection.

After each commit (an abort seems to be not that interesting) the http-smalltalk code send an event with a topic and perhaps an additional information via its PUSH socket to python program. This one serializes all incoming requests via its PULL socket and transfer the contents to a PUB-socket (also opened in the same program).

All to be written external service programs must have now SUB (subscribe) sockets opened to the PUB-socket of the python program and (whatever they subscribe) they receive the informations from the now more active Gemstone database – which can now be called and event oriented database :-))))

Filed under: Smalltalk Tagged: 0MQ, Gemstone, Python

May 27, 2016

Torsten Bergmann - Epicea in Pharo 6

Torsten Bergmann - Who uses Smalltalk

A new article from Richard Eng on who uses Smalltalk.

There are many people and projects all over the world who use Smalltalk. And yes it is true that mostly new projects start in more "fashioned" languages like Java. So this is more a question about how well known Smalltalk is and about popularity. There is also this common misbelief that new technologies must be better out of the box. I have some doubts in that - because today many software technologies or languages are very specific, written in a hurry or lack a solid and stable engineering foundation.

My answer to the question on who uses Smalltalk would be much easier: anyone who is interested in clean OO solutions and knowledgable enough to value increased productivity and long term maintainability.

Torsten Bergmann - Pharo Newsletter

There is a low traffic “Pharo Newsletter” Mailinglist. If you want to join read here.

May 26, 2016

Pharo Weekly - Pharo Newsletter May 2016

The big news of the month of course is that Pharo50 has been released! This is our most significant release yet. Here are some highlights:

  • The PharoVM is now based on Spur, the new memory management, and it brings with it a 35% speedup!
  • A new unified foreign function interface (UFFI) replaced.
  • …overall all 2400 issue tracker entries closed.

You can read the official announcement here:

Pharo Mooc

The Pharo Mooc saw a constant increase of participants with 2700 participants from more than 90 countries. It is entering its fourth week. More information
Pharo 6

With the stable release out, we have started a new development branch. As always, we slowed integrating changes while stabilizing the release, so this new development branch is seeing lots of changes that were held back.

As always, we do not ignore simple (even trivial) changes and have seen already many improvements related to typos, comments, cleanups… as well as some big-ticket items. One example here is support for immutable objects.

64bit Pharo: A Preview

The 64bit version of Pharo was able to run the whole image this week! Here is a screenshot:


Sysmocom: Free Software for Mobile Communication


Sysmocom is a leading provider of Free Software Mobile Communication solutions. In 2012 we have started a long term project to develop a complete ASN1, TCAP, MAP, CAP, GSM stack using the Pharo Object Environment. We have decided to use Pharo because of the increased productivity, the great tooling, the live inspection and if necessary modification of a running system to deploy a critical bugfix. Pharo has allowed us to focus on what is important.

The stack was used to uncover security and privacy issues inherent to the MAP protocol design in 2014/2015. We have used the stack to build a carrier-grade AuthenticationCenter (AuC) and helped a customer to move their production traffic off a proprietary system to ours. We look forward to move a HomeLocationRegister (HLR) into production this year.

Holger Freyther CEO.

See for more success stories.

Pharo Weekly - Register to the monthly report


Some time ago we set up a very low traffic “Pharo Newsletter” Mailinglist.

The idea is that this gets:
	-> a mail for the release
	-> *one* mail at the end of the month with 2-4 topics

It seems to work well. We have until now send two monty mails and the
mail for the Pharo5 release.

If you want to be on it, here is a link to subscribe:

If you follow all blogs, twitter + read all mails, there might not be anything new, but as things
get even hard to follow for me it might be a good way to keep up with the most important things

And: if you have an idea for content (e.g. highlighting a project or a success story), please get in


May 25, 2016

German Arduino - New PasswordsPro version available

Torsten Bergmann - Visualize Commit History

Hernán Morales Durand - Visualize commit history in Pharo

Overview This is another GraphViz post for Pharo Smalltalk. A few days ago I committed a working version of GraphBuilder. It was mostly coded by Lukas Renggli and I updated the package to work with the current Pharo images and added minor features (like displaying commit date in the nodes). Installation and Usage To install the package, open the Catalog Browser, select and install GraphViz, or

Torsten Bergmann - GitRepositoryScanner

A small tool to show local FileTree repositories in GTSpotter, as a way to add them into repositories list. Read more.

Torsten Bergmann - Panama Papers: a case for reproducible research, data activism and frictionless data

Want to step into the details of the Panama leak using Pharo? Then continue reading here.

May 24, 2016

Pharo Weekly - Pharo 64 bits… preview :)

Today Clément Béra helped Esteban Lorenzano porting the 32 to 64 bits bootstrap to Pharo. It looks like we have a Pharo 64 bits image on 64 bits VM running on Mac & Linux.
Here is the wonderful screenshot showing the amazing result:
Screen Shot 2016-05-24 at 3.19.23 PM-1.png

Torsten Bergmann - Pharo 64 bit in preparation

Pharo 64 bits image on 64 bits VM running on Mac & Linux. Yay!!! Read more.

Smalltalk Jobs - Smalltalk Jobs – 5/24/16

From the ESUG mailing list.

Hi all,
If you are a Smalltalker, preferably also skilled in Java or other
languages this might be interesting for you.
UML, web services are nice if they are in your skill set as well.
Basic mastery of Dutch is nice, English is mandatory, this is for a
project at least till the end of this year in Amsterdam.
Get in touch with me if you are interested, but since they are in a
hurry: please ASAP.
Rob Vens

Rob Vens can be contacted firstname dot lastname at

Filed under: Employment

May 23, 2016

Göran Krampe - Spry Performance

When writing Spry I am so far mainly ignoring performance. The general execution of Spry code will be a regular interpreter (although stackless I hope) and not a JIT. But that doesn't prevent us from playing around and learning something!

In this article I do some silly experiments around interpreter startup time and fooling around with 40 million element arrays. As usual, I am fully aware that the languages (Pharo Smalltalk, NodeJS, Python) I compare with a) have lots of other ways to do things b) may not have been used exactly as someone else would have done it. A truck load of salt required. Now... let's go!

Startup time

Spry is pretty fast starting up which obviously has to do with Spry not doing much at all when starting :)

So a trivial hello world being run using hashbang, executed 1000 times from another bash script, takes substantially less time than the same in Python. Useful benchmark? Not really, but obviously we can do scripting with Spry and at least not paying much for startup times! Here are the two trivial scripts and the bash script running them 1000 times:

``` bash

!/usr/bin/env spry

echo "Hello world" ```

``` bash

!/usr/bin/env python

print "Hello World" ```

``` sh


Run a trivial hashbang Spry script 1000 times

for run in {1..1000} do ./ done ```

If we run the above, first for and then, as reported by time: ``` bash


real 0m4.071s user 0m0.740s sys 0m0.428s


real 0m13.812s user 0m8.904s sys 0m2.324s

Empty shell script for comparison

real 0m2.505s user 0m0.024s sys 0m0.176s ```

Hum! So a trivial Spry script is 3-10x quicker depending on what you count (real clock vs cpu time etc), and... no, it's not output to stdout that is the issue, even a "silent" program that just concatenates "hello" with "world" suffers similarly in Python.

We can of course also compile this into a binary by embedding the Spry source code in a Nim program - it's actually trival to do. The 5th line below could of course be a full script. Since the Spry interpreter is modular we can pick some base modules to include, in this case the IO module is needed for echo to work so we add it to the interpreter on line 3:

nimrod import spryvm, modules/spryio let spry = newInterpreter() spry.addIO() discard spry.eval """[ echo "Hello World" ]""" ..and then we build a binary using nim c -d:release hello.nim and if we run that instead from the same bash loop we get: real 0m0.840s user 0m0.028s sys 0m0.096s

Of course Python can do lots of similar tricks, so I am not making any claims! But still very neat. And oh, we didn't even try comparing to Pharo here :) Startup times is definitely not a strength of Smalltalk systems in general, typically due to lack of minimal images etc.

40 million ints

I wanted to create some fat collection and do some loops over it. Spry has a universal ordered collection called a Block. Smalltalk has it's workhorse OrderedCollection. Nodejs has an Array. Let's stuff one with 40 million integers and then sum them up!

NOTE: The first numbers published were a bit off and I also realized an issue with Cog and LargeIntegers so this article is adjusted.

Pharo 4 with the Cog VM:

  • Populating the collection: 3 seconds
  • Sum the collection using iteration: 15 seconds
  • Populating the collection with 1s only: 2 seconds
  • Sum the collection of 1s (staying within SmallInteger) using iteration: 0.6 seconds!

NodeJS 4.4.1:

  • Populating the collection: 0.6 seconds! (weird! sometimes much slower)
  • Sum the collection using iteration: 3 seconds
  • Sum the collection using reduce: 1.2 seconds

Python 2.7.10:

  • Populating the collection: 7 seconds
  • Sum the collection using iteration: 4 seconds
  • Sum the collection using interation with lambda: 4 seconds!
  • Using sum function: 0.3 seconds!


  • Populating the collection: 72 seconds (cough)
  • Sum the collection using iteration: 101 seconds (cough, cough)

Spry with activation record reuse:

  • Populating the collection: 32 seconds (better)
  • Sum the collection using iteration: 60 seconds (better)



  • So Cog kicks proverbial ass when not spilling into LargeIntegers! Impressed.
  • NodeJS is fast, we know that, but Cog beats it on the iteration which was interesting. But NodejS populating in 0.6 seconds? Weird! Sometimes it took 10 seconds, it was almost like NodeJS had some odd "warm caching" going on.
  • Spry... is slow :) But a bit of activation record reuse definitely improved it by 2x.
  • Python is definitely surprising me! Wow, especially populating in 7 seconds and summing with lambda in 4? Impressive.

If we spend some time profiling Spry we can quickly conclude that the main bottleneck is the lack of a binding phase in Spry - or in other words - every time we run a block, we lookup all words! Unless I am reading the profile wrong I think the endless lookups make up almost half the execution time. So that needs fixing. And I also will move to a stackless interpreter down the line, and that should give us a bit more.

And what about Python's sum function that did it in whopping 0.3 seconds? Yep, definitely the way to go with an optimized primitive function for this, which brings me to...

Spry Secret Weapon

The secret weapon of Spry!

One core idea of Spry is to make a Smalltalk-ish language with its inner machinery implemented in Nim using Nim data types. So the collection work horse in Spry, the block is just a Nim seq under the hood. This is very important.

Combined with a very simple way of making Nim primitives we can quickly cobble up a 6 line primitive word called sum that will sum up the ints in a block. We simply use the fact that we know the block consists only of integers. I am guessing the sum function of Python does something similar.

Here is the code heavily commented:


nimPrim is a Nim macro to make Spry primitives

First argument is the word to bind, second is if

this is an infix word (first argument on the left)

and finally how many arguments the primitive expects.

nimPrim("sum", true, 1): # The local variable spry refers to the Interpreter # evalArgInfix(spry) is a function call that returns # the infix argument evaluated at the call site. # We then cast this to a SeqComposite which is the # abstract super type of Blocks. let blk = SeqComposite(evalArgInfix(spry)) var sum = 0 # This is Nim iteration over the nodes member # of the SeqComposite, a seq of Nodes. for each in blk.nodes:

# We cast the node to IntVal since we know
# it's an int, and then we can get the value member
# which is a regular Nim int.
sum = sum + IntVal(each).value

# All Spry functions returns Nodes so we wrap the int # as a Node using newValue() which will wrap it as an # IntVal. return newValue(sum) ``` It's worth noting that almost all primitive words in Spry are written using this same pattern - so there are lots of examples to look at! Of course this is a bit of "cheating" but it's also interesting to see how easy it is for us to drop down to Nim in Spry. We create a new word bound to a primitive function in exactly 6 lines of code.

So how fast is Spry using this primitive word? It sums up in blazing 0.15 seconds, about 100x faster than Cog and 10x faster than NodeJS for summing up. And yeah, even 2x faster than Python!

And yes, we can easily make this primitive smarter to handle blocks with a mix of ints and floats and a proper exception if there is something else in there - then it ends up being 17 lines of code, and still almost as fast, 0.17-0.18 seconds! I love you Nim.

In summary, Cog - which is what I am most interested in comparing with - is fast but my personal goal is to get Spry within 5x slower in general speed - and that will be a good number for a pure interpreter vs an advanced JIT. And if we throw in primitive words - which is not hard - Spry can be very fast!

May 22, 2016

Torsten Bergmann - Sysmocom

Free Software for Mobile Communication in Pharo. Read more.

May 21, 2016

Pharo Weekly - Pharo 60 Development is starting

18253 formatter misplaces some block comments

18267 Add Class comments to Refactoring-Core-Model classes

18284 SmallFloat64 identityHash is answering bad value

18078 FileSystem>>ModificationTime

18185 privSaveImageWithCleanup should yield Processor during waiting

18275 Improve tests coverage of Matrix

18044 Use iconNamed: instead of relying on DNU [Nautilus]

18238 PluggableTextMorph is not well update on theme change.

18227 TestRunner use component lacking/with incomplete #themeChanged

18240 PluggableButtonMorph does not update his text color on themeChanged

18276 Update glamorousBrowse and testRunner icons

18274 improve testing of UUID and remove createStringStartingAt:for:

18132 BlockClosure>>bench prints time instead of frequency when it runs for more than benchtime

18192 InputEventFetcher class>>#deinstall uses deprecated startup API

18268 Add Class comments to Refactoring-Core-Conditions classes
18264 WriteBarrierTest are failing. Maybe put on “expected” for now

16084 introduce pragma “ignoreUnimplementedCalls:”

18262 safe usage of optional StartupPreferencesLoader in the PharoCommandLineHandler
18248 TextAction>>rubActOnClick:for:in:editor: missing

18270 add #themeChanged method for GLMTabLabelBrick

18266 OCClassScope should ask class directly to find variable

18245 StringMorph and Label morph lack #themeChanged
18256 move HTTPProgress to the Network-Kernel package

18255 Improve documentation and tests for Integer methods for digits access

17802 Convenient methods for Message and MessageSend

18260 UUID tests should be moved to Tests package
17451 Introducing Immutability


18039 Missing testing methods on vmParameter

18250 Fuel has no platform for Pharo 6.0

18235 isClassOrTrait is false for Metaclasses

18047 Use iconNamed: instead of relying on DNU [Spec]

18197 Text asUrl makes the package Network-Url dependent on Text

18251 add 50 repo for now so we can merge

18200 TextAction calls unimplemented method #cull:cull:cull:cull:cull:

18199 “close all debuggers” could also be in the taskbar context menu

18229 Allow String>>#repeat: to repeat a string 0 times

18191 remove FFI classes from ReleaseTest>>#testKeyClassesArePresentInStartupList

18201 Reflectivity depends on Relfectivity-Tools

18015 TApplyingOnClassSide class heirarchy speedup
17896 MorphTreeMorph have trouble to update his theme


18230 Critic Browser window title set to nil after deselecting a rule
18173 fix #allClasses for RBBrowserEnvironments

17938 Show abstract classes in ClassWidget with emphasis 2

18129 ThemeIcons should store icons in an IdentityDictionarry

18148 NEC should guess global variables

18193 TxText cleaning

Torsten Bergmann - HashIds

Generate short unique ids from integers also for Smalltalk. Read more

Torsten Bergmann - OpenSmalltalk virtual machine repo

The virtual machine used for open source Smalltalks like Squeak and Pharo is now moved from Subversion to GitHub.

Read about the details.

May 20, 2016

Torsten Bergmann - TokyoDB

I did not know yet about this project from Esteban:

TokyoDB is a Pharo wrapper for Tokyo Cabinet.

May 18, 2016

Torsten Bergmann - Pharo 6 development

As Pharo 5.0 is now available for download the work on Pharo 6.0 directly started. There are already nice things in the pipe like Immutability

Torsten Bergmann - Virtual Machines and Managed Runtimes

Want to learn about virtual machine programming? Then have a look here.

May 17, 2016

The Weekly Squeak - Virtual Machines and Managed Runtimes


Mario Wolczko writes:

In early 2015 I was honored to be invited to develop and present a graduate course on Virtual Machines at UC Berkeley. The result is CS294-113: Virtual Machines and Managed Runtimes, which was presented in the Fall of 2015.

This page contains the materials from that course. All materials are Copyright © Oracle and Mario Wolczko, 2015-6, except as noted. The materials can be used non-commercially under the following Creative Commons license:

Virtual Machines and Managed Runtimes


I’d like to express my thanks to the following:

  • Patrick Li, my T.A. for the course. Patrick devised the Feeny language used in the exercises, wrote the Lab exercises and the model answers, and did all the grading,
  • Prof. Jonathan Bachrach for the invitation to give the course,
  • The guest speakers (in order of appearance): Peter Deutsch, Allan Schiffman, David Ungar, Cliff Click, Lars Bak, Carl Friedrich Bolz, Thomas Würthinger and Michael Van De Vanter,
  • My management at Oracle Labs for supporting this effort,
  • Michael Haupt for sharing his VM course material,
  • Christian Wimmer for assistance with Truffle, and
  • All the students who participated, for their patience, enthusiasm, attention, questions, efforts and feedback.


Cincom Smalltalk - Smalltalk Digest: May Edition

The May edition of The Cincom Smalltalk Digest is available now.

May 16, 2016

Cincom Smalltalk - “Hunt for Treasure” – The Quest Continues

Last year, Christian Haider, a Cincom Smalltalk™ partner, and Helge Nowak presented the open data project, "Schatzkarte," at the code.talks conference.

May 15, 2016

Pharo Weekly - Pharo packages for ArchLinux


I've updated Pharo packages for ArchLinux. Could you please update
install procedure on ?

Install Pharo launcher + Spur + old VM using command line:
  $ yaourt pharo-launcher

then run:
  $ pharo-launcher

(or look into your desktop menu for Pharo Launcher)

Note: PharoLauncher is automatically configured to run Pharo images
with right VM.

More informations on packages:
- pharo-launcher:
- pharo-spur-vm:
- pharo-vm (old VM):

Thanks for Pharo 5 :)

Laurent Laffont