Planet Smalltalk

April 22, 2014

Pharo News - ST 4U 551: Basic Debugging in Pharo

This post is dedicated to James Robertson. The whole community
is deeply saddened by the news of his passing last week.

Here is one of his "Smalltalk 4 you" videos:

"Continuing on with the basic usage series, today we debug a small issue in Pharo code"

April 21, 2014

Torsten Bergmann - James Robertson

This blog post is devoted to James Robertson - I was deeply saddened by the news of his passing last week.
My deepest condolences to his family and friends.

We both shared a common interest in spreading technical news on Smalltalk, dynamic languages and OOP technologies as we both devoted our technology blogs to it - often pointing to each others news items.

We first met personally in March 2000 in San Diego - as part of a group of crazy people coming together for hacking on various stuff to unify and harmonize the ST industry world with the first CampSmalltalk.

Following his example I started blogging in 2004 and over the years we exchanged a bunch of emails, comments and posts on technical topics.

I enjoyed reading his blog, was listening to every single episode of his "Industry Misinterpretations" podcast series, used his BottomFeeder aggregator, enjoyed his videos from conferences that I missed and I appreciated his short videos on how to use various technologies. James - thanks for all of that!

The amount of work and time you devoted to moving us all forward is just amazing. You will be missed!



Benoit St-Jean - Chalten

Une nouvelle librairie pour la gestion des dates, du temps, des durées, des fuseaux horaires et des calendriers vient de se pointer le nez : Chalten.  Quoique dans bien des cas la librairie Chronos suffise à la tâche, Chalten offre de toutes nouvelles possibilités dans un paradigme assez différent de ce à quoi l’on s’attend habituellement.  L’approche utilisée est très intéressante, voire brillante!

Chalten est disponible sur Pharo, VisualAge, Squeak, GemStone et VisualWorks!!


Classé dans:Gemstone, Gemstone/S, Pharo, Smalltalk, Squeak, VisualAge, VisualWorks Tagged: Chalten, Chronos, gemstone, Pharo, Smalltalk, Squeak, VisualAge, VisualWorks

Cincom Smalltalk - Saying Good-bye to Friend and Smalltalk Advocate, James Robertson

It brings us much sadness to report that our good friend and Smalltalk promoter/advocate, James Anderson Robertson, passed away suddenly at his home on Thursday, April 17, 2014.

Smalltalk Jobs - Smalltalk Advocate James Robertson Has Passed Away

Suddenly, this past Thursday, April 17th, the staunch advocate for Smalltalk, James Robertson passed away.

I have contributed my Smalltalk Jobs report audio segment to James’ podcast since 2006, and I knew him as a passionate advocate for Smalltalk and our community well before that.

If you have a favorite memory you wish to share with his family, or if you wish to view a video of his funeral service, you may do so at his memorial page.

I and the wider Smalltalk community were enriched by his presence, and while his loss to us will be nearly as great, his legacy will be long lasting and not forgotten.

James T. Savidge
View James T. Savidge's profile on LinkedIn

This blog’s RSS Feed


Filed under: Community

April 20, 2014

Pierce Ng - Pharo Smalltalk on Ubuntu 14.04 64bit

I run Debian 6 64bit on one of my servers. To run the 32bit Pharo/Cog VM, 32bit libraries are needed and are installed thusly:

# apt-get install ia32-libs

Trying out the newly released Ubuntu 14.04, I learn that ia32-libs is considered a hack and was deprecated in 2013 versions of Ubuntu. I guess the idea is to encourage people to know what they require more precisely.

To get the current Pharo-VM-linux-stable.zip to work on Ubuntu 14.04 64bit, install the following packages:

# apt-get lib32gcc1 
# apt-get libssl0.9.8:i386

On libssl, that is, OpenSSL, Ubuntu also ships 1.0.1f-1ubuntu2, which patches the Heartbleed bug, so you may install that instead.

April 18, 2014

Benoit St-Jean - James Robertson : 1961-2014

Une chanson que j’associerai à tout jamais à James… C’était l’intro de ses podcasts…

Deeply, de Bôa


Classé dans:musique, Smalltalk Tagged: Bôa, Deeply, musique, Smalltalk

Eliot Miranda - Primitives and the Partial Read Barrier

Aperitivo If you’ve read my post on the partial read barrier you’ll know that one of the issues in the new Spur VM is how primitives deal with forwarding objects amongst their arguments. Recall that become: is lazy and is implemented by copying objects and updating the originals to be forwarding pointers to the copies. […]

Benoit St-Jean - James Robertson

C’est avec une grande tristesse que nous apprenons le décès de James Robertson, figure bien connue de tous dans la communauté Smalltalk…

Nos pensées et condoléances à sa famille et ses amis.


Classé dans:Smalltalk Tagged: James Robertson, Smalltalk

Benoit St-Jean - SciSmalltalk 0.9

À tous ceux qui ont à faire du traitement numérique, des statistiques ou dont les programmes Smalltalk nécessitent des mathématiques non triviales, sachez que le code de l’excellent livre de Didier H. Besset, Object-Oriented Implementation of Numerical Methods: An Introduction with Java & Smalltalk, a été porté (et est maintenu) depuis un certain temps sur Pharo Smalltalk.

La version 0.9 du package SciSmalltalk vient de sortir tel qu’annoncé ici!

Les initiés reconnaîtront, ci-dessous, un attracteur de Lorentz. Le graphique a été généré par l’engin de visualisation Roassal!

AttracteurDeLorentz

Vous pouvez suivre le développement de SciSmalltalk sur Twitter (@SciSmalltalk), sur GitHub (ici), sur Google Groups (ici) ou sur la mailing list de Google Groups (scismalltalk@googlegroups.com).

Le port original du code de Besset est disponible ici pour ceux qui oseraient s’aventurer à amener SciSmalltalk/DhbNumerical sur une autre plate-forme Smalltalk…


Classé dans:mathématiques, Packages, Pharo, Smalltalk, statistiques Tagged: attracteur de Lorentz, Didier H. Besset, mathématiques, Object-Oriented Implementation of Numerical Methods: An Introduction with Java & Smalltalk, Pharo, Roassal, SciSmalltalk, Smalltalk, statistiques, traitement numérique

Pharo News - [ANN] SciSmalltalk v0.9 is out

The SciSmalltalk project provides tools for scientific computation in Smalltalk.

more here: https://github.com/SergeStinckwich/SciSmalltalk

ble65b3cyaekmor.jpg-large.jpeg

Pharo Weekly - Commits: March 3

30823

30822

30821

30820

30819

30818

30817

30816

30815


Benoit St-Jean - Sista

Pour ceux qui s’intéressent aux VM Smalltalk (Cog), aux compilateurs et à l’optimisation, un excellent article (en anglais) sur Sista par Clément Béra ici.


Classé dans:Cog, Machine virtuelle, Smalltalk, VM Tagged: Cog, compilateur, optimisation, Sista, Smalltalk, VM

Clément Béra - The Sista chronicles V: First optimized method running

Hey guys,

For the last 3 weeks, I have been in San Francisco to work on Sista with Eliot Miranda, especially on the communication between the in-image optimizer and the Cog runtime / Cog JIT. Last tuesday, for the first time, the VM detected a hot spot via a tripping counter, then called the in-image optimizer, which optimized the method, installed it, and at the next call the optimized method was used (Do not misunderstand me, on-the-fly stack replacement does not work yet). This is a big step. However, the VM right now does not implement all the additional sista bytecodes and inlined primitives so the optimized methods performance is quite low :-(.

With the current settings we (we = Eliot Miranda and I) have, while running the Pharo kernel tests, 5350 counters tripped, which in fact corresponds to 187 different tripping methods (so yeah, the assumption that the code usually run almost always the same methods is verified). Basically the optimizer was able to optimize 80 methods out of the 187. The optimizer failures were mostly due to:

  • (2750/5350 cases) send data information forbidding inlining (Right now the optimization is cancelled if some critical sends are not inlined):
    • 950 megamorphic inline cache on the inlining path
    • 600 polymorphic inline cache on the inlining path
    • 1150 missing send data on the inlining path. This could mean that the counter trip on an uncommon case, i.e., the tripping method was called 65000 times from a certain method, but the last time, when the counter tripped, it was called from another method rarely used. It can also be due to some unexpected machine code garbage collection
  • (1250/5350 cases) the VM not being stable enough right now in the mapping machine code pc -> bytecode pc (only the Sista VM is not stable)

Interestingly, some non local returns are very hard to optimize, but in the current model, I had only 17 optimizations out of 5350 that cancelled due to unoptimizable non local returns. Therefore I assume this is not a common case.

Another interesting point, out of over a thousand successful method optimizations, only a 5 of them exceeded 50 ms, which is the maximum pause a user can tolerate. As the Spur garbage collector of Pharo 4 will double Pharo’s performance, this case is therefore also uncommon (at least on my Macbook 2.5Ghz Intel Core i5 with lots of applications running aside).

There is a long way to go before an alpha version though. I noticed that the optimizer decompilation and the inlining optimizations passes are *very* stable (thanks Ronie Salgado for showing me a good design for the inliner), but the range optimizations are not finished, and the byte code generation is not very good and even sometimes leads to incorrect byte codes. My next move will be on the code generation part to stabilize the overall optimizer.

Recently I simplified a lot the algorithms to convert the control flow graph to SSA (single static assignment) and the liveness analysis by studying Crankshaft, javascript V8 optimizing compiler (See information about Crankshaft on this blog and the clean C++ source code here). The new algorithm’s performance is very similar for the SSA conversion (even though the algorithm is much simpler), and the liveness analysis is just *way* faster for big methods.

The V8′s design influence on sista is nice, as I was for a long time strongly influenced by LLVM’s design (information about LLVM here), whereas the implementation of static C compiler usually prefers slow algorithm finding the perfect solution for an issue instead of a fast algorithm finding a suboptimal but almost perfect solution. However, you can still feel the C compilers influence by looking at the control flow graph manipulations which are much more aggressive than V8′s ones. In some way we could say that Sista is an hybrid optimizer based on GCC’s, LLVM’s and V8′s design. This is partly because some of Sista’s features (postponing the optimization to the a background process when it takes more than 50 ms, incremental optimizations) allows to spend more time on the optimizer.

The byte code generation have a main issues right now: the number of temporaries in optimized method is huge. There are several reasons for that:

  • The deSSA (algorithm that removes phi nodes) performs poorly. This is because I took it from an old prototype, and it is supposed to merge multiple temporaries only if they were the same temporaries in their unoptimized method, forcing the optimizer to create extra temporaries at each inlining pass. The idea was to keep values for the deoptimization process. However, having now implemented the deoptimization and having it working, I can tell you that this is complete non sense. The Sista intermediate representation is completely independent of any temporary representation, in fact a temporary in the Sista IR just means a slot on the stack that have the SSA property. And I didn’t invent anything there, Crankshaft’s intermediate representation hydrogen is also temporary variable independent.
  • After inlining multiple methods, the number of temps of each method, and in addition their “hidden” temporaries due to loops or stack top values, are added.
  • Currently the deoptimization requires that each value needed in the deoptimization scopes to be put in a temporary variables in the byte code, whereas for most of them I could just use the top of the stack. This is not a real problem, as the solution mostly consists in spending time on improving it.

To improve this issue, I am completely rewriting the conversion from the SSA control flow graph to Opal’s IR, the bytecode generator input. The main difference is that the deSSA algorithm will now merge as many temps as possible thanks to Briggs-Chaitin graph coloring algorithm and use a V8-inspired algorithm for liveness analysis. This should greatly decrease the number of temporaries (especially after inlining).

[BEGIN graph coloring digression ...]

The general idea of Briggs-Chaitin graph coloring algorithm is that you want to color each node of a graph such as there can’t be 2 nodes with a relationship having the same color. In the real world, each node is a sista IR temporary (let’s say a stack location, it’s not really a temporary) before the algorithm, and after the algorithm each node having the same color can share the same temporary variable index in the byte code. This algorithm is usually used for register allocation, but sista doesn’t allocate the registers, this is left to the low level JIT. However, my issue of reducing the number of temporary variables is clearly similar to register allocation.

As I am able to visualize everything I do in a few minutes thanks to Roassal (It took me only 4 min 42 sec to program this visualization, Roassal is *so* helpful, thank you Roassal guys), here are some visualizations of the Graph Coloring algorithm:

10 nodes and 3 colors:
Screen Shot 2014-04-17 at 3.46.33 PM

12 nodes and 4 colors:
Screen Shot 2014-04-17 at 3.51.12 PM

30 nodes and 7 colors:
Screen Shot 2014-04-17 at 5.31.13 PM

Now I just need to make it work nicely with my deSSA and byte code generation passes :-). I will be in vacation for the next two weeks so it may take a while.

[END graph coloring digression ...]

By the way, I know I still need to write down what method I optimize when a counter trips based on the current execution stack and why (and I said I would do so, I’m sorry I haven’t done it yet). For the ones that have read Urs Hölzle phd, you know that the method to optimize is not necessarily the method that has the tripping counter. Therefore you need to add some logic to find the best method to optimize. That is done and working, but I need to spend time to write about it…

Anyway I still recommend to read Urs phd, my explanation will obviously be less good than Urs’ ones, as he has a better English style and as I discussed with Eliot Miranda recently, the way he explains things make the optimizer’s concepts looking like they are very simple whereas they are very complex, which shows how good he is.

Hope you enjoyed the post !

PS: If you are interested in a specific aspect of Sista that I do not mention in my blog posts, please say it in the comment, I will answer you or perhaps even write a dedicated post.


April 17, 2014

Pharo Weekly - Font Awesome for Seaside

Hi,

FontAwesome is (as you may know) an iconic font designed for the user with Twitter Bootstrap.

I now created a "FontAwesome for Seaside" project - which is a small Seaside wrapper for the 
FontAwesome project (using the latest version 4.0.3). 

This is intended as an addition to the already available "Bootstrap for Seaside" [2] project 
that I wrote and both should allow you to give your Smalltalk based web application a nice 
stylish look.

The project is located on STHub, see [1] where you will also find the documentation.

A live demo can be found on http://pharo.pharocloud.com/fontawesome.

To try yourself load it from the Pharo config browser or read the docu to see what is required.

Thx
T.

[1] http://smalltalkhub.com/#!/~TorstenBergmann/FontAwesome
[2] http://smalltalkhub.com/#!/~TorstenBergmann/Bootstrap

Pharo Weekly - Mapless

Sebastian Sastre juste released Mapless.

Mapless is a small framework for storing objects in a key->data fashion (i.e.: noSQL databases) without requiring any kind of object-data map. So far only MongoDB is supported. It can use Redis for reactivity (pub/sub) and cache.

Motivation

I wanted to persist objects with extremely low friction and extremely low maintenanceand great scaling and availability capabilities so Mapless is totally biased towards that. This framework is what I came up with after incorporating my experience withAggregate.

There is no spoon…

There is no object-relational impedance…

There is no instVars…

only persistence :D
 
Code and instructions here:
 
https://github.com/sebastianconcept/Mapless
 
All MIT, enjoy
 

Torsten Bergmann - Mapless

Mapless is a small framework for storing objects in a key->data fashion (i.e.: noSQL databases) without requiring any kind of object-data map. So far only MongoDB is supported. Read more here or on GitHub.

Torsten Bergmann - Aggregate

Aggregate is a small persistance framework with a clean API and full ACID features that uses OmniBase as backend and supports BTree-based indexing. Find more on GitHub

Torsten Bergmann - Versionner for Pharo 3.0

How to use the new Versionner tool in Pharo 3.0:


ESUG news - [ANN] FontAwesome for Seaside

Torsten Bergmann announce FontAwesome for Seaside:

FontAwesome is (as you may know) an iconic font designed for the user with Twitter Bootstrap.

I now created a "FontAwesome for Seaside" project - which is a small Seaside wrapper for the FontAwesome project (using the latest version 4.0.3).

This is intended as an addition to the already available "Bootstrap for Seaside" [2] project that I wrote and both should allow you to give your Smalltalk based web application a nice stylish look.

The project is located on STHub, see [1] where you will also find the documentation.

A live demo can be found on http://pharo.pharocloud.com/fontawesome.

To try yourself load it from the Pharo config browser or read the docu to see what is required.

Thx T.

Torsten Bergmann - FontAwesome for Seaside

FontAwesome is (as you may know) an iconic font designed for the user with Twitter Bootstrap.

I now created a "FontAwesome for Seaside" project - which is a small Seaside wrapper for the FontAwesome project (using the latest version 4.0.3).

This is intended as an addition to the already available "Bootstrap for Seaside" project that I wrote and both should allow you to give your Smalltalk based web application a nice stylish look.

The project is located on STHub, there you will also find the documentation. A live demo can be found on http://pharo.pharocloud.com/fontawesome.

To try yourself load it from the Pharo 3.0 configuration browser or read the docu to see what is required.

April 16, 2014

Cincom Smalltalk - Smalltalk Digest: April Edition

A special edition of The Cincom Smalltalk Digest dedicated to James Robertson is available now.

Smalltalk Jobs - Smalltalk Developer, UK, France, Belgium, Netherlands, Germany or Switzerland

Cincom’s ChannelStream project is looking for a developer.  ChannelStream uses VisualWorks and Seaside.  The candidate can be based in the UK, France, Belgium, Netherlands, Germany or Switzerland (and must obviously be OK with some travel and some remote working, screen-sharing and etc.).  Strong Smalltalk development skills are wanted.  The role includes occasional work onsite with customers.


Filed under: Employment

Cincom Smalltalk - Do You Want to Play “2048”?

By Arden Thomas, Cincom Smalltalk Product Manager.

Pharo News - AstroCloud - using Pharo and Roassal to visualise Molecular Clouds

AstroCloud is an application that uses Roassal engine (built on top of Pharo Smalltalk) to visualize astronomy images. Read more or have a look at the pictures here.

Code is on SmalltalkHub.

(via http://astares.blogspot.de)

External Page: 1294375_617967844956483_8154602562247258197_o.png

JR's Smalltalk 4 You - ST 4U 558: Tabbed Browsing in CST

Instead of opening multiple browsers in VW or OS, you can simply open multiple views in a single browser

April 15, 2014

Smalltalk Jobs - Smalltalk Jobs – 4/15/14

  • Atlanta, GAJunior Gemstone Database Administrator at IntercontinentalExchange (ICE)
    • Required Skills:
      • Bachelor’s Degree in Computer Science or commensurate experience.
      • Basic Smalltalk
      • Strong communication skills
      • Must work well in a fast-paced, deadline driven environment
      • Organized, strong initiative and teamwork orientation are necessary
    • Wanted Skills:
      • VisualWorks
      • GemStone administration (but company will train for the DBA role)
      • UNIX experience and scripting
      • Knowledge of basic DB principles
Good luck with your job hunting,
James T. Savidge

View James T. Savidge's profile on LinkedIn

This blog’s RSS Feed


Filed under: Employment

Torsten Bergmann - AstroCloud - using Pharo Smalltalk and Roassal engine to visualize Stars and Molecular Clouds

AstroCloud is an application that uses Roassal engine (built on top of Pharo Smalltalk) to visualize astronomy images. Read more or have a look at the pictures here.

Code is on SmalltalkHub.

Cincom Smalltalk - The New Class ‒ PowerState

The Windows operating system provides a comprehensive, system-wide set of power-management features. This enables systems to extend battery life and save energy, reduce heat and noise and help ensure data reliability.

Arden Thomas - 2048

2048

Afternoon app – 2048

You may or may have not heard about a popular new game called 2048.

We have some very exciting new work in our development builds, a new source code editor, which I wanted to exercise.

Around the same time, I saw the article linked above about the game 2048.  It is a simple four by four grid with numbers that you slide around, trying to add them up to …… 2048!

Image

I downloaded a free version of 2048 onto my iPhone, and there is also browser based version here. I checked it out and it looked pretty interesting, so I decided to implement a simple version of it as an “afternoon app”.  An Afternoon app is a simple time-boxed implementation.  Since Smalltalk lets you do a lot in a short amount of time, it is a great choice.

I built it and published it on the public repository.  You can find it as TwentyFortyEight.

It is an MVC designed app with these three classes.

TwentyFortyEightApp

TwentyFortyEightModel

TwentyFortyEightView

I reverse engineered it by observation.  I tried a couple simple ways to process the moves, then refined them.    My #process:  method takes an array of the four items in a row or column, and looks like this:

process: array

“process an array of the grid”

self compress: array.

self combine: array.

self compress: array.

^array

#compress:         slides the elements down to the far end of the array.

#combine:           adds adjacent cells of the same number, one pass

The second compress is required in situations where there are two combines in the one pass.

Since you can move four directions, up, down, left, right, it gives #process the row or column for right, down respectively.  For left and up it reverses the array for #process, and then flips it back for integration into the grid.

I made an assumption which turned out to process incorrectly in some circumstances.  Rather than fix it, I left it as a challenge to find (not too hard, not to trivial) and change for those who want to tinker with the application.   There is another needed fix (hint: the new value that appears) which is a very easy fix.

How can the implementation be improved?  Other than the needed fix mentioned above, the application does not detect when the game is over, or allow you to restart it.  These are easy fixes.

Another relatively easy improvement would be to add the running score.  When numbers are combined, their value can be added to the score tally.

A big improvement that would take some more time would be to add animation.  This would probably require model restructuring or changes to communicate in terms of the moves in order for the view to animate them. Visually, adding animation would be a big improvement.  I welcome any developers to give it a try and share their results.  I may give it a shot myself.

What else could you do?  You could try using different algorithms for auto-playing the game, in order to discover or test heuristics in order to maximize your score.

If you have any more ideas or any questions, I would be happy to hear from you.  Reach me at the email below.

Best Regards and happy Smalltalking!

Arden Thomas

athomas@cincom.com

Cincom Smalltalk Product Manager