[Esug-list] Github / Pharo / VisualWorks porting tools

Christian Haider christian.haider at smalltalked-visuals.com
Wed Sep 18 11:24:16 EDT 2019

Hi Carsten,


there is the bundle {Smalltalk Transform Project} which includes the machinery for porting VisualWorks to Gemstone.

I started to add Pharo, but have not finished yet. In Gemstone I could use namespaces which is not possible in Pharo.

For translating VW to Squeak/Phara/Cuis/VA/etc. the namespaced class (and shared) names need to be renamed to global names.

This is not trivial and I was working on that, but it is not finished (and don’t know if I even will finish it – jump in if you need it 😊).


My take on porting is a bit different from the typical one-shot approaches I have seen so far. 

Instead of freezing a piece of code and then more or less manually translating the code,

I describe the code transformation from the source to the target dialect in a declarative way.

(see slides 11 to 20 in https://www.slideshare.net/esug/pdftalk-for-gemstone from ESUG 2017).

This allows for leaving the source code unchanged and is fully repeatable. 

This is important when your source code base is changing and you need to port the code on a regular basis.


In practice, instead of changing the code in the target dialect, you change the transformation which produces the target code.

With this, you can use all Smalltalk tools in the source dialect in the live environment in which the code is working, especially #references and the RB rewrite engine.

The transformations can be:

*	Ignore a source class or method
*	Add a new class or method to the target which does not exist in the source
*	Replace the source of a method by some other source
*	Rewrite a method with a rewrite rule

Here is an example of such a transformation (for the basic fonts package of PDFtalk):

PackageChange localChanges: (Array

                               with: (ClassChange

                                               classReference: #{PDFtalk.Fonts.Font}

                                               instanceChanges: (Array

                                                               with: (Rewrite method: #fontbody rule: #replaceGemstoneErrorClasses)

                                                               with: (Ignore method: #screenFont)

                                                               with: (Ignore method: #screenFontDescription)

                                                               with: (Ignore method: #screenFamilyName))

                                               classChanges: (Array

                                                               with: (Replace method: #loadedFonts code: #_gs_loadedFonts)

                                                               with: (Replace method: #fontClasses code: #_gs_fontClasses)))

                               with: (ClassChange

                                               classReference: #{PDFtalk.Fonts.FontBody}

                                               instanceChanges: (Array with: (Rewrite method: #encoder rule: #replaceDottedName))

                                               classChanges: (Array with: (Rewrite method: #tokenLinesFrom: rule: #replaceGemstoneBaseMethods))))


If you are interested, you can ask me for further explanations.

(All code is in the public store under MIT licence)


Happy hacking,




Von: Esug-list <esug-list-bounces at lists.esug.org> Im Auftrag von Carsten Härle
Gesendet: Dienstag, 17. September 2019 14:36
An: esug-list at lists.esug.org
Betreff: [Esug-list] Github / Pharo / VisualWorks porting tools




there is a lot of Smalltalk code in Github for Pharo and VisualWorks.

The main repository for Seaside seems to be Github also. 


Which VisualWorks tools are available to support code exchange with Github and Pharo?

How does the Cincom developer team do the porting of new versions, e.g. for Seaside? 


I found a Cypress interchange format implementation for VisualWorks from Travis Griggs:



However the code 7 years old and does not work in current VisualWorks  versions and has several bugs. 

I started fixing it, but before I invest to much effort, I would  like to ask how other people do the porting from and to Github / Pharo or other dialects.





Carsten Härle, 

straightec GmbH, Frankfurter Straße 48, 63150 Heusenstamm, Germany

+49 6104  6008-0



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.esug.org/pipermail/esug-list_lists.esug.org/attachments/20190918/f61bc1b2/attachment.html>

More information about the Esug-list mailing list