1900 Participants for the Pharo Mooc


The new session of the Pharo Mooc just started and you can still registered and have fun learning a cool system ūüôā





Open AL script

Hi Phil,

I did that using Ronie’s OpenAL binding and Merwann’s wav parser back in 2014-2015:

owner: ‘ronsaldo’
project: ‘OpenAL’

owner: ‘MerwanOuddane’
project: ‘WAVParser’

I did things such as (build yourself something derived from this code I did not check if it works):

WAVParser wavFromStream: (‘resources/music/spellNoise.wav’ asFileReference readStream binary readStream).
contextAttributes := ALContextAttributes new.
device := OpenALC openDefaultDevice.
context := device createContext: contextAttributes asList.
context process.
context currentDuring: [
“Create the buffer”
buffer := self makeBufferFromHeader: wav header data: wav data asByteArray.
“Create the source”
source := OpenAL genSource.
OpenAL sourcei: source param: AL_BUFFER value: buffer.
“Play the source”
OpenAL sourcePlay: source.
“Play for sometime ”
(Delay forSeconds: wav header soundDuration) wait.
“Delete the source and the buffer”
OpenAL deleteSource: source;
deleteBuffer: buffer
OpenALC nullCurrentContext.
context destroy.
device close.

MyClass>>makeBufferFromHeader: header data: data
| buffer |
buffer := OpenAL genBuffer.
OpenAL bufferData: buffer format: (self readFormatFromHeader: header) data: data size: data size freq: header sampleRate.
^ buffer

MyClass>>readFormatFromHeader: header
^ header channels = 1
ifTrue: [
header bitsPerSample = 8
ifTrue: [ AL_FORMAT_MONO8 ]
ifFalse: [ AL_FORMAT_MONO16 ] ]
ifFalse: [
header bitsPerSample = 8
ifFalse: [ AL_FORMAT_STEREO16 ] ]

I am pretty sure with a little work those things could work again. I have never succeeded in playing mp3 files from Pharo though (but I’m on mac and I remembered trying solutions that did not work on Mac but may work on other OS).

Have fun guys ūüôā

Libusb binding


A bit late, there is a Libusb [1] binding (using UFFI) and support for the Human Interface Device [2] (that uses the binding but is written in pure Smalltalk) for Pharo.
Everything is on the github repository [3]. ¬ę¬†Install¬†¬Ľ ¬†and ¬ę Quick start¬†¬Ľ ¬†sections give you all you need to start using the project.
One could also have a look at the wiki [4].
It works on Linux but hasn’t been tested on Mac OS nor Windows (it should work since libusb library works on these platforms).
Do not forget to install the 32 bits versions of libusb on your computer.
The purpose of this library is to provide the ability to use USB devices directly from Pharo.
For example, one could get data from a PS3 controller, a mouse, a keyboard, an Arduino device, etc…
PS: I realised this project during an internship in TaMère SCRL company [5]. Thanks to them!

Last PR log



20442 open the welcome window


20462 An error in the Tests never break the build



20440 integrate ReferenceFinder



20461 Update Hermes to v2.2.1



20410 Undeclared variables should be compiled with explicit class UndeclaredVariable



20421 Email should run in a node and separate stage to be sent



20447 SystemVersion>>highestUpdate not initialized and nil



20459 Comment class ImportingResourceHelp


20444 FFIExternalStructurePlatformTests cleanup (is32/64bit)


20445 Uncategorized or wrongly categorized deepCopy, veryDeepCopy, shallowCopy and postCopy methods



20458 Two uncommented classes in Reflectivity package


20446 Properly categorize finalize and finalizeValues



20443 SDL_Event not initialized



20435 The CI process should fail if the conversion fails



20415 Restore the extra morphic worlds properly on startup



20434 use Ring2 during the bootstrap



20431 Move initialization of Color, InstructionStream and SmallInteger



20437 Uncategorized methods in RFCondition and RFMessageNode



20436 Pull request URL in build information e-mail is wrong



20423 Add health check that all class instance variable names in the system are lowercase



20429 ContextTest>>#testSetUp is dependent on Opal


20433 Fix the parsing of the PR description when sending the mail



20428 ClassTest (Kernel-Tests) is dependent on System-Changes


20424 standalone SUnit tests are failing after integration of the new version of Hermes



The story around PharoMinimal


What is the story around PharoMinimal and related images ?

Is there a writeup somewhere with instructions ?

Right now the minimal (Metacello) image based on Pharo 7 is used only as intermediate step in building of the full Pharo and the only real (successful) attempt to use it for something else is PharoLambda (https://gitlab.com/macta/PharoLambda).
In general it can be used for building of own (server) applications. E.g. this way you can install and run Teapot on it:
./pharo¬†Pharo7.0-metacello-32bit-d13eed2.image¬†eval¬†–no-quit “Teapot on GET: ‘/welcome’ -> ‘Hello World’; start.”
You can load baselines from the Git repositories too but we currently do not have any command line handler for it so you need to do it using “eval” command or *.st¬†flile. Something like this:
Metacello new
baseline: ‘Seaside3’;
repository: ‘github://SeasideSt/Seaside:master/repository’;
To make it more usable we probably should extend it with SUnit and Fuel. If you want to extend it with some packages from vanilla Pharo, you should load them using FileTree from your local Pharo repository clone.
Gofer it
url: ‘filetree:///path-to-my-pharo-repository-clone/pharo/src’;
package: ‘Multilingual-OtherLanguages’;
package: ‘Multilingual-TextConverterOtherLanguages’;
It still needs some care. E.g. some classes from Zinc are not properly initialized (I know about DigitalSignatureAlgorithm MD5NonPrimitive RxMatcher RxParserRxsPredicate SHA1 ZnByteEncoder ZnConstants ZnMimeType ZnNetworkingUtils ZnServer ZnSingleThreadedServer TextConstants TextAction TextStyle).
I tried to load Seaside into it today (from the example above) and it failed (some strange error probalby related to Unicode processing). But we will fix it. If you will tell me what exactly you need we can make it work together as in case of PharoLambda.
followed by
Hi Pavel,

Thanks a lot for the explanation. To summarise: 70-minimal is the one with monticello and metacello in it that can load code via the config handler.

I was confused, because that failed for me.

Now, first doing

$ ./pharo pharo-minimal.image eval ‘ZnMimeType initialize’

fixed my loading problem. I also did the following because some of my project don’t separate tests (I known ūüėČ

$ ./pharo pharo-minimal.image eval –save ‘Object subclass: #TestCase’

With those fixes I was able to load different projects

$ ./pharo pharo-minimal config¬†http://mc.stfx.eu/Neo¬†ConfigurationOfZTimestamp –install=stable

$ ./pharo pharo-minimal config¬†http://mc.stfx.eu/Neo¬†ConfigurationOfNeoConsole –install=bleedingEdge

The image remains equally fast in startup

$ time ./pharo pharo-minimal.image eval ZTimestamp now
real    0m0.062s
user    0m0.025s
sys     0m0.029s

And it works perfectly as a server, like

$ ./pharo pharo-minimal eval –no-quit ‘NeoConsoleTelnetServer new start’ &

$ telnet localhost 4999
Connected to localhost.
Escape character is ‘^]’.
Neo Console Pharo-7.0+alpha.build.172.sha.d13eed2f80fe19f29fd85ede8c4809d6a6986d4f (32 Bit)
> get
known metrics:
system.status – Simple system status
memory.total – Total allocated memory
memory.free – Free memory
memory.gc – Garbage collect, return free memory
system.uptime – Image uptime human readeable
system.uptimeseconds – Image uptime seconds
system.date – Current date
system.time – Current time
system.timestamp – Current timestamp
process.count – Current process count
process.list – Current list of processes
system.version – Image version info
system.mcversions – Monticello packages version info
> get process.list
Delay Scheduling Process
Low Space Watcher
Idle Process
WeakArray Finalization Process
NeoConsoleTelnetServer port 4999
NeoConsoleTelnetServer port 4999 Connection Handler
> SessionManager default startupList collect: #handledId

#(#SmallInteger #Delay #ProcessorScheduler #OSPlatform #FileLocator #MCMethodDefinition #WeakArray #FileStream #MultiByteFileStream #EndianDetector #Symbol #LanguageEnvironment #Stdio #NonInteractiveTranscript #WeakFinalizationList #DiskStore #BasicCommandLineHandler #SourceFileArray #ASTCache #UUIDGenerator #InternetConfiguration #ZnLogEvent #ZnServer #Color #UIManagerSessionHandler #ZTimestamp)
Connection closed by foreign host.

Image size remains ~11Mb.

Very nice !

Seaside on minimal Pharo 70


I was successfully able to run Seaside on the minimal Pharo 7.0. After the release cleanup the resultant image has about 12.4 MiB.
The loading script expects that in the working directory you have the Pharo repository clone (in a floder named ‘pharo’). You should modify the loading script to point to your real Pharo repository clone. This clone is needed to load SUnit into the minimal image. You should have¬†PharoV60.sources reachable from the image.
The Seaside is loaded from my fork (github://pavel-krivanek/Seaside:minimalPharo/repository). I had to create a modified version because the original baseline broke the ZincHTTPComponents.
The strange line:
Smalltalk vm parameterAt: 25 put: (Smalltalk vm parameterAt: 25) * 50.
…sets the garbage collector. Without this the Seaside loading can fail on insufficient object memory.
wget -O –¬†http://get.pharo.org/70-minimal¬†| bash
pharo Pharo.image loadSeaside.st –save –quit
pharo Pharo.image startSeaside.st –no-quit
Starting of the image takes about 0.1 s on my machine.
— Pavel

Fun with UI Avatars

I came across https://ui-avatars.com, a web service that creates avatar images based on some parameters.

From Pharo, the shortest invocation would be something like
Making use of the full builder interface of ZnClient that would look more like
ZnClient new
host: ‘ui-avatars.com‘;
addPath: #api;
queryAt: #name put: ‘Albert Einstein’;
queryAt: #size put: 128;
queryAt: #color put: ‘FFF’;
queryAt: #background put: ‘0D8ABC’;
queryAt: #rounded put: true;
accept: ZnMimeType imagePng;
enforceHttpSuccess: true;
enforceAcceptContentType: true;
contentReader: [ :entity | ImageReadWriter formFromStream: entity readStream ];
Anyway, it is cool to have an environment that makes this kind of experimentation so much fun.
It is probably easy to implement this avatar image generation directly in Pharo …

Bugfix and enhancements release v0.2.5 for OSSubprocess

Dear all,

I have just released a new bugfix and enhancements release v0.2.5 for OSSubprocess as you can see in [1].
This new release is thanks to the awesome work of Guillermo Polito [2]. He found a problem (and a fix) that would hung/block the Pharo image in a wait state. This problem has been forever and I have faced it myself. It would only happen when using #waitForExit and under certain scenario.  Because of that, I recommend everyone to move to this release.
Aside from that serious bug, he has also done quite some improvements in the tests and in the Travis setup. Once this PR [3] has been merged and SmalltalkCI updated, our Travis build [4] should show all green builds for Linux/OSX and Pharo 5.0 and 6.1.
I have also copied the configuration into Pharo 5.0 and 6.0 catalog so as of tomorrow, it should be there.