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
<https://ci.inria.fr/pharo-contribution/job/PharoBookWorkInProgress/lastSuccessfulBuild/artifact/book-result/Glorp/Glorp.pdf>,
and I will welcome suggestions and corrections as pull requests to
<https://github.com/SquareBracketAssociates/PharoInProgress>

The Glorp repository is the same as the previous one
(http://www.smalltalkhub.com/#!/~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 <glorp-group@googlegroups.com>.

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:

http://pharo.org/news/pharo-5.0-released

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:

8f398205-df62-4920-bd02-944282aff675.png

Sysmocom: Free Software for Mobile Communication

5faf528c-086b-4ab4-9bc0-b42d040726d2.jpg

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. http://www.sysmocom.de

See http://www.pharo.org/success for more success stories.


Pharo Weekly - Register to the monthly report

Hi,

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:

	http://pharo.us11.list-manage.com/subscribe?u=6f667565c2569234585a7be77&id=048680a940

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
happening.

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

	Marcus

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.
Thanks,
Rob Vens


Rob Vens can be contacted firstname dot lastname at reflektis.com.


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

!/bin/bash

Run a trivial hashbang Spry script 1000 times

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

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

Spry

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

Python

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!

Spry:

  • 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)

Ehum...

NOTES

  • 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

60027
18253 formatter misplaces some block comments
https://pharo.fogbugz.com/f/cases/18253

18267 Add Class comments to Refactoring-Core-Model classes
https://pharo.fogbugz.com/f/cases/18267

18284 SmallFloat64 identityHash is answering bad value
https://pharo.fogbugz.com/f/cases/18284

60025
18078 FileSystem>>ModificationTime
https://pharo.fogbugz.com/f/cases/18078

18185 privSaveImageWithCleanup should yield Processor during waiting
https://pharo.fogbugz.com/f/cases/18185

18275 Improve tests coverage of Matrix
https://pharo.fogbugz.com/f/cases/18275

60024
18044 Use iconNamed: instead of relying on DNU [Nautilus]
https://pharo.fogbugz.com/f/cases/18044

18238 PluggableTextMorph is not well update on theme change.
https://pharo.fogbugz.com/f/cases/18238

18227 TestRunner use component lacking/with incomplete #themeChanged
https://pharo.fogbugz.com/f/cases/18227

60023
18240 PluggableButtonMorph does not update his text color on themeChanged
https://pharo.fogbugz.com/f/cases/18240

18276 Update glamorousBrowse and testRunner icons
https://pharo.fogbugz.com/f/cases/18276

60022
18274 improve testing of UUID and remove createStringStartingAt:for:
https://pharo.fogbugz.com/f/cases/18274

18132 BlockClosure>>bench prints time instead of frequency when it runs for more than benchtime
https://pharo.fogbugz.com/f/cases/18132

18192 InputEventFetcher class>>#deinstall uses deprecated startup API
https://pharo.fogbugz.com/f/cases/18192

18268 Add Class comments to Refactoring-Core-Conditions classes
https://pharo.fogbugz.com/f/cases/18268
60021
18264 WriteBarrierTest are failing. Maybe put on “expected” for now
https://pharo.fogbugz.com/f/cases/18264

16084 introduce pragma “ignoreUnimplementedCalls:”
https://pharo.fogbugz.com/f/cases/16084

18262 safe usage of optional StartupPreferencesLoader in the PharoCommandLineHandler
https://pharo.fogbugz.com/f/cases/18262
60020
18248 TextAction>>rubActOnClick:for:in:editor: missing
https://pharo.fogbugz.com/f/cases/18248

18270 add #themeChanged method for GLMTabLabelBrick
https://pharo.fogbugz.com/f/cases/18270

18266 OCClassScope should ask class directly to find variable
https://pharo.fogbugz.com/f/cases/18266

60019
18245 StringMorph and Label morph lack #themeChanged
https://pharo.fogbugz.com/f/cases/18245
60018
18256 move HTTPProgress to the Network-Kernel package
https://pharo.fogbugz.com/f/cases/18256

18255 Improve documentation and tests for Integer methods for digits access
https://pharo.fogbugz.com/f/cases/18255

17802 Convenient methods for Message and MessageSend
https://pharo.fogbugz.com/f/cases/17802

18260 UUID tests should be moved to Tests package
https://pharo.fogbugz.com/f/cases/18260
60017
17451 Introducing Immutability
https://pharo.fogbugz.com/f/cases/17451

60016

http://files.pharo.org/image/60/60016.zip

60015
18039 Missing testing methods on vmParameter
https://pharo.fogbugz.com/f/cases/18039

18250 Fuel has no platform for Pharo 6.0
https://pharo.fogbugz.com/f/cases/18250

18235 isClassOrTrait is false for Metaclasses
https://pharo.fogbugz.com/f/cases/18235

60014
18047 Use iconNamed: instead of relying on DNU [Spec]
https://pharo.fogbugz.com/f/cases/18047

60013
18197 Text asUrl makes the package Network-Url dependent on Text
https://pharo.fogbugz.com/f/cases/18197

18251 add 50 repo for now so we can merge
https://pharo.fogbugz.com/f/cases/18251

60011
18200 TextAction calls unimplemented method #cull:cull:cull:cull:cull:
https://pharo.fogbugz.com/f/cases/18200

18199 “close all debuggers” could also be in the taskbar context menu
https://pharo.fogbugz.com/f/cases/18199

60010
18229 Allow String>>#repeat: to repeat a string 0 times
https://pharo.fogbugz.com/f/cases/18229

60009
18191 remove FFI classes from ReleaseTest>>#testKeyClassesArePresentInStartupList
https://pharo.fogbugz.com/f/cases/18191

18201 Reflectivity depends on Relfectivity-Tools
https://pharo.fogbugz.com/f/cases/18201

60008
18015 TApplyingOnClassSide class heirarchy speedup
https://pharo.fogbugz.com/f/cases/18015
60007
17896 MorphTreeMorph have trouble to update his theme
https://pharo.fogbugz.com/f/cases/17896

60006

18230 Critic Browser window title set to nil after deselecting a rule
https://pharo.fogbugz.com/f/cases/18230
60005
18173 fix #allClasses for RBBrowserEnvironments
https://pharo.fogbugz.com/f/cases/18173

60004
17938 Show abstract classes in ClassWidget with emphasis 2
https://pharo.fogbugz.com/f/cases/17938

60003
18129 ThemeIcons should store icons in an IdentityDictionarry
https://pharo.fogbugz.com/f/cases/18129

60002
18148 NEC should guess global variables
https://pharo.fogbugz.com/f/cases/18148

60001
18193 TxText cleaning
https://pharo.fogbugz.com/f/cases/18193


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

DeutschInLineCache

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

Acknowledgements

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

Hi,

I've updated Pharo packages for ArchLinux. Could you please update
install procedure on http://pharo.org/gnu-linux-installation ?


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: https://aur.archlinux.org/packages/pharo-launcher/
- pharo-spur-vm: https://aur.archlinux.org/packages/pharo-spur-vm/
- pharo-vm (old VM): https://aur.archlinux.org/packages/pharo-vm/


Thanks for Pharo 5 :)

Laurent Laffont