Monthly Archives: March 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


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:

  • No writing on the disk
  • No access to the source code (by the shortcuts, debugger,…)
  • No error displaying on the interface
  • The only thing accessible is the user application

I let you discover it on:


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.

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