Planet Squeak

blogs about Squeak, Pharo, Croquet and family
planet squeak - planet squeak es - planet squeak jp - planet croquet - planet squeak code - planet smalltalk

March 18, 2018

Pierce Ng


I've just added RIPEMD160 to the EVP interface in OpenSSL-Pharo. This post serves as a HOWTO.

OpenSSL's C interface defines RIPEMD160 thusly:

const EVP_MD *EVP_ripemd160(void);

Create LcLibCrypto>>apiEvpRIPEMD160 for it:

  ^ self ffiCall: #(EVP_MD* EVP_ripemd160 ())
    module: self library

Next, create LcEvpRIPEMD160 as a subclass of LcEvpMessageDigest:

LcEvpMessageDigest subclass: #LcEvpRIPEMD160
  instanceVariableNames: ''
  classVariableNames: ''
  package: 'OpenSSL-EVP'

  super initialize.
  handle := LcLibCrypto current apiEvpRIPEMD160.
  self errorIfNull: handle

Add class-side accessors:

LcEvpRIPEMD160 class>>blocksize
  ^ 64

LcEvpRIPEMD160 class>>hashsize
  ^ 20

And that's it! Using the test vectors from the RIPEMD160 home page and RFC 2286, the unit tests verify that we can now use RIPEMD160 for hashing and HMAC from within Pharo:

  | msg result |

  msg := ''.
  result := ByteArray readHexFrom: '9c1185a5c5e9fc54612808977ee8f548b2258d31' readStream.
  self assert: (md hashMessage: msg) equals: result

  | msg result expectedResult |

  msg := 'Hi There'.
  key := ByteArray readHexFrom: '0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b0b' readStream.
  expectedResult := ByteArray readHexFrom: '24cb4bd67d20fc1a5d2ed7732dcc39377f0a5668' readStream.
  result := (HMAC on: LcEvpRIPEMD160)
    key: key;
    digestMessage: msg asByteArray.
  self assert: result equals: expectedResult

by Pierce Ng at March 18, 2018 03:45 PM

March 16, 2018

Torsten Bergmann

Pharo to Anki

Using Pharo to create Anki decks that help to deliberately practice Japanese grammar by visualizing.

by Torsten ( at March 16, 2018 07:37 AM

March 15, 2018

Torsten Bergmann

Instance inspection in Pharo

The Pharo Inspector on classes now has “instances” view. I added this a a few days ago and forgot to send a message to the list so anyone knows. Looks like I should blog more about my contributions again.

by Torsten ( at March 15, 2018 07:25 AM

Pharo AWS SDK with SNS support

The Pharo AWS SDK now supports Amazon Simple Notification Service (SNS)

by Torsten ( at March 15, 2018 06:58 AM


Making Twitter Bootstrap work with Seaside 3.1 on Squeak 5.1

Tobias Pape solved the problem here:



Add class side method to

TBSBootstrapExample class >>methodNamed: aSymbol
^ self >> aSymbol

The “>>” message is from Behavior…take the time to look it up, its a great one for the toolbox.


Add instance side method to:


CompiledMethod >sourceCode
^ self getSource


My hunch is that this is a pharo thing that does not port to Seaside until now.



by timothy at March 15, 2018 12:24 AM

March 14, 2018

Torsten Bergmann

Feenk work on a Diagrammer for Pharo in Bloc

The Feenk team is working on on Diagrammer in Pharo. The idea is that developers should not have to leave the IDE - not even for drawing diagrams and they give a nice graphic preview on a more elaborate control of lines and figures in this tool with some screenshots on their twitter account.

 - Preview 1
 - Preview 2
 - Preview 3

This nicely shows what is already possible in Bloc.

by Torsten ( at March 14, 2018 01:39 PM

March 13, 2018

Torsten Bergmann

Pharo-sentry v0.2.2 releases

The unofficial Pharo SDK for Sentry error tracking platform from Peter is available with a new 0.2.2. release. Now with support for breadcrumbs and basic context.

Code is here:

by Torsten ( at March 13, 2018 04:48 PM

Updated DiscordsSt for Pharo

A new version of DiscordsSt, An API wrapper for Discord written in Pharo

by Torsten ( at March 13, 2018 12:37 PM

March 11, 2018


Bloc, brick and GT update


Here is an update of the work on Bloc, Brick and GT. As always, please do let us know what you think.

– Improved the deletion in the text editor and covered the scenarios with examples
– Worked on the text selection. Still work needed for selection to be production ready:
– Balanced rope structure for even better performance of the editor. Overall, the performance of the text editor improved 2x.
– Selectable curves:

– Resizer overlay. The tweet below also shows how we can now easily script dragging behavior in examples:

– Diagrammer is a new engine for drawing diagrams based on Bloc. This is the first version, and we will continue working on it in the following weeks, so stay tuned for more news. This is also one of the first Bloc applications:
– Andrei put together a beautiful description of a scenario in which an application is molded interactively in the Playground & Inspector. The subject is face recognition, and the resulting code is both functional and explainable. This is intended as a tutorial material that shows what moldable development means and how it changes the way we program:

Have fun,
The feenk team

by Stéphane Ducasse at March 11, 2018 08:08 PM

Torsten Bergmann

Playing with face detection in Pharo

A nice medium article from Andrei Chis on "Playing with face detection in Pharo"

by Torsten ( at March 11, 2018 07:11 PM

March 09, 2018


Cruiser: A Pharo app packager

Hi Pharoers!

I pleased to announce you the first release of Cruiser: a tool to package your Pharo applications. The idea is to quickly convert an application from a development environment to a production one. A production environment means:

I let you discover it on:


by Stéphane Ducasse at March 09, 2018 08:28 PM

March 08, 2018


Sista VM screen cast: Tracking bugs in optimized code

by Stéphane Ducasse at March 08, 2018 10:49 AM

March 07, 2018

Torsten Bergmann

Clean and modular stateful traits for Pharo

Pharo 7 now integrated (beside many others) a special pull request (PR) to integrate a new version of Traits, this version includes the following features:

- Stateful Traits
- Modular implementation, it is loaded after bootstrap
- Cleaner interface
- Reducing duplicate methods as Traits extends from Class

Since Pharo also has Traits, Slots, MetaLinks, ClassAnnotations and other meta facilities it is a very nice lively system to also work on the metalevel and do metaprogramming.

by Torsten ( at March 07, 2018 10:32 PM

Shortcuts in Settings tool

With the latest version of Commander and the new Calypso Code Browser, all shortcuts are
explorable and configurable.

by Torsten ( at March 07, 2018 10:25 PM

Clement Bera

Sista VM Screencast

Hi all,

Recently I gave a demo at HPI on how I use the Cog VM simulator to step into machine code while simulating a Pharo image. Normally I like to do blog posts and I don’t like videos (videos take more time to do and I don’t like my French accent which makes them hard to follow), but it’s really difficult to explain what I am doing in this case without a video. Therefore I made a screencast where I show how I track down bugs in the Sista optimized code and how I debug them in the Cog VM simulator through machine code single stepping. If want to read a blog post on the VM simulator instead of a video you may want to look at one of my old blog posts here.

The video shows first how I build an image crashing at start-up on an optimized Sista method. Second, it shows how I simulate it with the VM simulator, including how I set different kinds of break point in machine code compilation and execution to track down where the problem comes from.

The image used for VM simulation can be built following those instructions.

I hope you will like the screen cast. Don’t hesitate to ask questions. Sorry for the French accent.

by Clement Bera at March 07, 2018 03:41 PM


OSSubprocess for 64bits

Hi guys,

Thanks for Guillermo Polito we now have 64 bits support for OSSubprocess. You can see the required changes in this PR [1]. I made a branch called `support64bits` so that you can help us test it even if CI said it was good [2]. If you do test it and come back to us with the results, please tell us which OS you used.
To install from the branch:
Metacello new
  configuration: ‘OSSubprocess’;
  repository: ‘github://marianopeck/OSSubprocess:support64bits/repository’;
version: #stable;
Roadmap: Current release is v0.2.5. So I will let that release for Pharo <= 5.0. I will make a new release with the Pharo 64 bits and call it v0.3. That release should be used for Pharo 6.x. Once v0.3 is out, I will make a new release v0.4 with some changes I wanted to do since a loooong time and its a small refactor to minimize OSSubprocess dependency on OSProcesses primitives (at VM side). This is thanks to Holger Freyther and Alistair Grant [3]. As that requires a new VM, then v0.4 should be used in Pharo >= 7.0.

by Stéphane Ducasse at March 07, 2018 02:13 PM

Torsten Bergmann

SQLite Loadable Extensions for Pharo

Pierce implemented SQLite Loadable Extensions and you can find it in the UDBC repository.

by Torsten ( at March 07, 2018 10:07 AM

Pharo Bitcoin's BIP39 mnemonic

Esteban Maringolo provides a simple implementation of Bitcoin's BIP39 mnemonic for Pharo

by Torsten ( at March 07, 2018 10:03 AM

OSSubprocess - 64 bits support preview

The "OSSubprocess" project for Pharo now provides a preview on 64bits support

by Torsten ( at March 07, 2018 10:01 AM

Terminal Emlation in Pharo

Pavel is resurrecting Terminal Emulation for Pharo. Read more.


by Torsten ( at March 07, 2018 07:21 AM

March 06, 2018

Hernan Morales

SpecUIAddOns release

I released yesterday SpecUIAddOns, a MIT library providing additional SPEC widgets not included in Pharo Smalltalk by default. If you have any suggestions for how this package could be improved, please get in touch or suggest an improvement using the GitHub issues page. Installation, screenshot and usage instructions are provided in the GitHub page.

by Hernán ( at March 06, 2018 03:43 AM

March 05, 2018


Pavel resurrecting terminal emulation


Guille is working on the Iceberg improvements and he wanted to be able to open a terminal window on top of the repository and interact with it via the command line. So we looked at this issue because I already in December made some experiments with the terminal emulation in Pharo.

In past, the Squeak had a working terminal emulation that used PseudoTTYPlugin. The VM is not built with this code for a long time but I tried to replace it with a small C library and then wrote an FFI interface to it. Together with that, I ported most of the old code Squeak code to Pharo.

With Guille we tried to avoid usage of such external library and wrote an FFI interface to all the required LibC functions. We were successful but we realized that there are several issues that are limiting us.

When you want to execute a separate process for the program that you want to open in terminal (typically the Bash), you need to redirect the standard IO files, create a fork of your process, do some additional initialization in it and call ‘exec’ on it. In the parent process, you change redirected IO files back to the original values.

But the problem is that between the FFI calls from Smalltalk the VM can do a lot of things including garbage collection etc. On OS X the fork() function has the following limitation described in man:

“There are limits to what you can do in the child process. To be totally safe you should restrict your yourself to only executing async-signal safe operations until such time as one of the exec functions is called.  All APIs, including global data symbols, in any framework or library should be assumed to be unsafe after a fork() unless explicitly documented to be safe or async-signal safe.  If you need to use these frameworks in the child process, you must exec.  In this situation it is reasonable to exec your-self. yourself.”

As the result in most cases (but not all) the fork() and exec() pair from the Smalltalk side fails on OS X. Linux does not have this limitation however even there we found an issue. It is bound to the fact that fork() makes a fork of all the parent process that uses the same resources. As soon as Pharo is opened in a window and X11 is involved (the window wants to be repainted), it can lead to the VM crash.

So we learned that unfortunately we currently cannot use image-only FFI code for this task. We need a C library or VM plugin.

The repository of the terminal emulator is here:

and can be loaded using the following code:

Metacello new
baseline: ‘TerminalEmulator’;
repository: ‘github://pavel-krivanek/terminal/src’;

#TerminalEmulator asClass compileLibrary.

It compiles and links the small library with only one function using the GCC so the machine needs to have a proper development environment.
The terminal emulator is in very early stage and has a lot of issues like processes cleanup, drawing, keyboard input etc. etc. If you are interested in it, feel free to contribute.

— Pavel

by Stéphane Ducasse at March 05, 2018 05:25 PM

March 04, 2018

Pierce Ng

SQLite Loadable Extensions

SQLite has the ability to load extensions at run-time. I've now implemented this functionality in UDBC-SQLite.

An SQLite extension is built as a .so/dylib/dll shared library file. Let's use SQLite's rot13 extension as our example. The source file rot13.c is located in the SQLite source code's ext/misc directory. To build the rot13 extension, also download the amalgamation. Unzip the amalgamation and copy rot13.c into its directory. Build the extension:

% gcc -fPIC -shared -o -I. rot13.c

Verify that the extension works:

% sqlite3
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> select rot13('qwerty');
Error: no such function: rot13
sqlite> .load "./"
sqlite> select rot13('qwerty');
sqlite> select rot13('djregl');

For use with Pharo, copy into the Pharo VM directory where all the other .so files are.

Next steps are done in Pharo. For the purpose of this blog post, I downloaded a fresh Pharo 60536 64-bit image. Start the image and install GlorpSQLite from the Catalog browser, which installs the latest UDBC-SQLite. (This also installs Glorp, of course. If you run Glorp's unit tests from Test Runner you should get all 890 tests passed.)

In a playground, run this snippet and Transcript should show, first, the text "no such function: rot13" and then the rot13 outputs.

| db rs r1 r2 |
Transcript clear.
db := UDBCSQLite3Connection openOn: ':memory:'.
[   [ db execute: 'select rot13(''qwerty'')' ]
      on: UDBCSQLite3Error
      do: [ ex: | Transcript show: ex messageText; cr ].
    db enableExtensions;          "<== New stuff."
      loadExtension: ''.  "<== New stuff."
    rs := db execute: 'select rot13(''qwerty'') as r1'.
    r1 := rs next at: 'r1'.
    Transcript show: r1; cr. 
    rs := db execute: 'select rot13(?) as r2' with: (Array with: r1).
    r2 := rs next at: 'r2'.
    Transcript show: r2; cr.
] ensure: [ db close ]

Note the messages #enableExtensions and #loadExtension:. For security reasons, extension loading is disabled by default.

Tested on Linux latest Pharo 64-bit 60536.

by Pierce Ng at March 04, 2018 03:49 PM

March 02, 2018

Torsten Bergmann

Amber Smalltalk 0.21.0

New release 0.21.0 of Amber Smalltalk is announced here.

by Torsten ( at March 02, 2018 11:55 PM

Actors for Squeak Smalltalk

A library to add an Erlang-style Actor model to Squeak.

by Torsten ( at March 02, 2018 11:35 PM

February 28, 2018

Torsten Bergmann

Code Critics Bar Charts for Pharo Smalltalk

can be found in the following Git project:

Would be interesting to compare Pharo 6.1 with Pharo 7alpha

by Torsten ( at February 28, 2018 10:43 PM


Pharo Smalltalk implementation of ELIZA, an early natural language processing computer program.

by Torsten ( at February 28, 2018 09:59 PM

Restore Open Croquet

Nikolay Suslov restored the original Open Croquet onto Squeak 6.x. Video is here.

by Torsten ( at February 28, 2018 09:49 PM

Teamtalk - Pharo Cluster execution

Teamtalk - Simple library to execute Pharo Smalltalk code in a cluster of Pharo Smalltalk instances. MapReduce is also supported. It is based on Vert.x using the VerStix library.

by Torsten ( at February 28, 2018 07:23 PM

Virtual Reality Live at Thales with Pharo

Thales is using Pharo together with the Woden 3D engine:

by Torsten ( at February 28, 2018 07:13 PM