[Seaside] Porting VW <-> Squeak - a short experience report

Holger Kleinsorgen h.kleinsorgen at i-views.de
Thu Sep 23 19:19:00 UTC 2010


after porting some packages from VW to Squeak and vice versa, I'd like 
to write a few random notes about it. Maybe it's helpful for others, or 
maybe someone can show me an easier way to port code ;)

The most convenient way to port packages is to use the great 
Monticello-Tools that ship with VisualWorks. Michael Lucas-Smith has 
recorded two screencasts:

Part 1: Monticello -> Store

Part 2: Store -> Monticello

- Loading Monticello packages into VW

The first thing you will need on the VW side is a suitable namespace 
which must import all required namespaces. This namespace has to be set 
as default namespace of the packages that are ported.
A good example is the Seaside namespace: it imports Grease and SUnit.

When loading a package from Monicello into VW for the first time, 
there's a good chance that it will be completely empty. Don't worry - 
set the default namespace of the Store package that has been created, 
and load the MC package again.

Make sure you load the packages in the correct order - there will be no 
feedback if classes could not be loaded.

- Publish Store packages to Monticello

When porting from VW to Squeak, dotted names have to be replaced with 
non-dotted ones. Again, default package namespaces help to solve this 

Then there's of course the general problem of portability. I haven't 
seen any Lint checks for VW that check the code for portability (similar 
to the ones available for Squeak).

There's an issue that methods with non-ISO-characters cannot be ported. 
Don't know if that's a limitation of the tools, Squeak or Monticello. If 
you do it, the package will be empty when loading it in Squeak.

And finally there's the issue of categories/protocols. VW code that 
doesn't have class categories and extension protocols that are suitable 
for Monticello will still load, but the result will be a mess.

To make life easier, I modified the Monticello tools a bit. The 
modifications are published in the public repository. Changes:
- added a toolbar button to set the default namespace before loading
- protect against non-byte-strings when writing MC packages (by raising 
an error ;)
- enforce "*<PackageName>" as category of methods and "<PackageName>" as 
category of classes when writing MC packages

More information about the seaside mailing list