Monthly Archives: June 2014

The Pharo way: One step after the other

13428 Small code critique cleanup of RecentSubmissions

13427 Small code critique clean of Tools


13425 Simplify API of VersionsBrowser

13426 retire old VersionsBrowser


13424 Clean up #priorTimeStamp

13423 VersionBrowser>>#versionCountForSelector:class: not needed

13420 Abstract slot class should emit code to reflectively read the slot

13419 remove OCInstanceVariable


13406 Opal should delegate code generation for Slots to the Slot meta object

13410 Wrong Nautilus is registered as default browser

13395 Add SHA256 HashFunction

– add subclass for Slot
– change all Slot objects for that class

13400 API for slots on Classes

13397 Failing tests SHA256Tests

13396 Failing test: ReleaseTests>>#testLocalMethodsOfTheClassShouldNotBeRepeatedInItsTraits

13395 Add SHA256 HashFunction

13379 ReleaseTests #testObsoleteClasses failing: AnObsoleteSourceWebBrowser

13287 Failing test: testLayoutIntegrity and testSlotScopeParallelism

13348 Display progress when running lint rules

13391 add #visibleSlots to layout


13378 DynamicVariable cannot be stepped in debugger

First class instance variables getting exciting

Marcus Denker is improving the interaction between the new compiler and the
first class instance variables and the results look exciting. I remember brainstorming and
prototyping a solution in 2007 with him and this is wonderful to see this getting real.
Here is the description made by Marcus:

So now Opal delegates code generation for read and write to the Slot meta objects.
The methods called are #emitValue: and #emitStore:, the parameter is an IRBuilder.

With this the implementor of a Slot is free to generate whatever bytecode needed, it will
be inlined at the read or assignment site in the method.

For the ivar Slot this is e.g. just

emitStore: methodBuilder

 methodBuilder storeInstVar: index

emitValue: methodBuilder

 methodBuilder pushInstVar: index.

Now the implementors of Slots should not need to be bothered about bytecode, therefore we have
in the superclass of all Slots defaults emit methods that implement a *reflective* read and write using
the MOP of the Slot itself (slower than code generation, but often enough):

emitValue: aMethodBuilder
 pushLiteral: self;
 send: #read:

emitStore: aMethodBuilder
 pushLiteral: self;
 send: #writeToSlot:of: 

What this means is that for someone who wants to implement a slot, you do not have to deal with bytecode at all.

Here is a simple Slot:

Slot subclass: #TestSlot
 instanceVariableNames: 'value'
 classVariableNames: ''
 category: 'Slot-Scope’

read: anObject
 ^ value

write: aValue to: anObject
 value := aValue

So this is a strange kind of Slot that stores the value in itself, which means it is shared between all objects as there is only
one Slot meta object per class per slot. (not something you want to do in real world, but a nice demo)

Now we can create a class (not yet easily as we have not yet enabled a class template, so lets use the ClassBuilder directly):

PharoClassInstaller make: [ :builder |
 builder name: #A;
 slots: { TestSlot named: #iv };
 category: #Playground ].

In class A we can implement accessors:


iv: anObject
 iv := anObject

They look like normal ivar accesses, but in the background, the compiler delegated to the Slot the code generation, calling emit*, which leads
to the bytecode e.g. for the read:

21 <20> pushConstant: iv => TestSlot
22 <70> self
23 <E1> send: read:
24 <7C> returnTop

you could override the emit* methods to generate faster code, but to get something running it is not needed.

To test, e.g. you can set the slot from one object and read it from another:

A new iv: 6
A new iv

Then inspect the slot:

(A slotNamed: #iv) inspect

(this should all Work in 4.0 048, the example is there as TestSlot for now)

…next steps:

1) Class Definition template for classes with Slots
2) How do we save these classes in Monticello?
3) Virtual Slots (Boolean and PropertySlots)



The legendary HP-35 Scientific Pocket Calculator

Sven van Caekenberghe wrote a new, extensive, long form, introductory article about Pharo:
A tutorial on Pharo, test and specification based immersive programming
It is a bit different because
 – it is based on a non-trivial example
 – it uses a backdrop story unrelated to Pharo
 – it uses several multimedia elements
 – it is published on which is a general publishing platform
The appendix describes several ways you can get the code. I think building both a Spec and Seaside UI from the same specification as well as reusing functional tests in different contexts is cool. Anyway, I hope you enjoy it.

A hackish week-end

13371 AlphaImageMorph should be move to the same package as ImageMorph

CheckboxButtonMorph should be move to the same package as its superclass

13352 Move some polymorphic extensions to their classes

13354 should move Tabs into Morphic-Widgets-Tabs

13362 FileList should be extracted from Tools and move to MorphicWidgets-FileList

13359 Pluggable* should be move out of Morpphic-Base and put in Morphic-Widgets-Pluggable

13363 Tools-Explorer category should be turned into Tool-Explorer package

13363 Tools-Explorer category should be turned into Tool-Explorer package

13358 TreeMorph* should be extracted from Morphic-Base and put in its own package

13361 Extracted Spotlight from tools and move it to Tool-Spotlight

13355 should extract Workspace in Tool-Workspace

13356 should move Morphic-base list into Morphic-Widgets-List

13351 Tool-Finder should be extracted from Tools

13350 Extract calendar to Morphic-Widgets-Extra

13323 Cleaning PasteUpMorph mouseDown:

13226 Inst Var Pull Up refactoring also shows superclass inst vars

10935 AthensDemoMorph failing at figure9

TaskIt: Handling Processes Nicely

S. Bragagnolo announced TaskIt.  Task IT is package that provides a cool way to deal with processes. Even when this version is stable, it still in design and we want to make it consistent and powerfull. It comes with a chapter in pharo enterprise book and some cool tests. 
We have moved the main distribution repo to CAR!/~CAR/TaskIT/
The main easy things to do with this revision are:

” closures “
val := [ 2+2 ] shootIt.
val isKindOf: TKTFuture.
val onSuccess: [: rslt | rslt == 4 ] “async”
val value == 4. ” sync “
rslt := [ 2+2 ] shootIt asResult.
rslt == 4 “sync on demand”
” objects “
val := 2 paralellize + 2.
val == 4 “sync on demand”
” staying in tune “
val := [ “some task” ] shootIt asStickyReference.
val := nil.
” sticky means that if this future is taken by the GC, it will kill the process”

” looping  “

val := server paralellize looping serveOnce: anyParameter asStickyReference.
“this will execute in a new process, in a loop, server serveOnce: anyParameter.”
You can stop it by doing
val:= nil.

“or using a disgusting magic variable, for that check the samples :). But do not rely on that kind of things, because it will not be supported “

For more advanced and cool usages, check the Doc.


1- Yes, the “sync” on demand is implemented with a proxy and a become.

2- Yes, we are changing the API of the processes that persist in time.

  All CAR team in general was great inspiration, particularly, Guille Polito full operational commiter and  of course is always a good idea to discuss with him,  Nick Papoylias, is also great to discuss with him. Luc, Noury, Jannik: several ideas are discussed with them as well, and they always gave me support.

and from RMOD Esteban Lorenzano, also discussing and proposing.

Thanks all :).
If you want to go to the darkside (dark because is not documented yet, but in the case of PoolIT, that it has some doc ) you can also add to your combo:
ActIT: a simple Actor extention for taskit.
ForkIT: an extention that runs blocks in background image (it adds a nice button to the test runner, letting you run all your tests in a background image and installing the results after the execution)
PoolIT: it adds a pool of workers, it consumes tasks and ensure you a limited amount of threads.
PlanIT: a basic and not yet full developed algebra for composing processes.

I encourage you to use it, it is being used in PhaROS since a lot  of time. And please any bug and enhancements, you can contact us. Since we are working on the next version is a good time to define what features are really needed.

Another week of enhancements

13343 Should move some spec morphic adapter extensions to their classes

11987 Launching ProfStef should now require initials

12579 SyntaxErrorNotification>>messageText


13341 small simplification: #morphicLayerNumberWithin:

13345 Fix some references to non-existing classes: MethodContext, MIMEType

12859 colorChangedForSubmorph: unused

13308 MNU in EyeMorphViewer

13242 SUnit shows wrong test result when Warning subclass signals on a test case method

13340 tiny recategorization of uncategorised methods

13332 fix #cleanUpForProduction for 4

13336 FontChooser and FontInfrastructure do not have the 40 repository added to themselves.

12860 valueOfProperty: #fileListModel.

13326 Gofer: Add loadBleedingEdge

13330 Small code critique cleanup in Tools

13089 reciprocalFloorLog: should be deprecated or just removed

13303 komitter is still using Pharo30Inbox as destination of new slices

13320 Clean old condense sources/changes

13321 findSubstringViaPrimitive: key in: body startingAt: start matchTable: matchTable do not rely to correct character in source.

13319 Small recategorization in Network-MIME to test money

13262 UITestCase in wrong package

13289 Failing test: ReleaseTest>>#testObsoleteClasses

13288 Failing test: CodeSimulationTests>>#testErrorCodeNotFound

13316 Nautilus sorts instVarNames

13277 Speed up String>>=

13286 Failing test: testBehaviorRespectsPolymorphismWithTraitBehavior

13314 Workspace save to file on accept does not take line ending settings into account

13281 Wrong environment when browsing scoped

13301 Update metacelloPlatformAttributes

13267 Settings Browser: Missing fields and file-dialogs in the Appearance Section

13285 duplicated test: testLocalMethodsOfTheClassShouldNotBeRepeatedInItsTraits


Norbert Hartl developed a package that contains util classes to en-/decode values into/from Base62/Base36.

Base62/Base36 encode numbers in short strings. These are used e.g. by url shortener services from google, etc. 

Base36 uses lowercase letters and numbers to encode, Base62 uses all characters from Base36 plus all uppercase letters. Base62 produces smaller strings while Base36 produces case insensitive ones.


Base62 fromNumber: 100000 -> 'q0U‘ 

Base36 fromNumber: 100000 -> ‚255s'

The package is available on SmalltalkHub.

40 alpha commits flow is going

12858 Remove hasRolloverBorder – Second part

12858 Remove hasRolloverBorder (Part 0)

13270 Starting to Clean Fonts – Package introduction

Tools saving to file without user feedback

Monticello choking on FTP repositories

valueOfProperty: #expandedExtent does not look to be set somewhere

fourth trial

13257 Pointless class creation menu in Nautilus

– add 30Inbox (to be removed later)

13255 PNGReadWriter fails to read some .png format and do not always correctly read transparency back

13279 Add MetaRepoForPharo30 as one of the switchable Repositories to ConfigBrowser

13278 ContextPart and MethodContext merged, remaining bugs

13282 Failing test: testGForceInria

– Unload Deprecated30

13280 integrate pharo dark theme

13273 ContextPart and MethodContext should be merged into a single class Context

This will need some more cleanups in a second step…
-> packages are dirty
-> some tests are failing