[squeak-dev] NanoTraits are go

Andreas Raab andreas.raab at gmx.de
Tue Dec 29 20:58:34 UTC 2009

Folks -

NanoTraits are ready to ship now. I've decided on a loading mechanism 
which preserves the original Trait classes in the image and reshapes 
them instead of having a different set of classes. This achieves maximum 
compatibility with external packages. The loading is done by first 
loading NanoTraits, converting all traits, reshaping the existing 
classes, and converting everything back. If you have a fully updated 
image, you can try the process by executing:

	MCMcmUpdater updateFromRepositories: #(

I decided to preserve *all* of the original structure (incl. class 
TraitBehavior and incl. all of the Kernel traits) since I noticed that 
various packages have extensions on those classes and would fail to load 
otherwise. This should provide very good backward compatibility for 
external packages.

Unless people voice concerns about this version I'll be pushing it into 
the trunk over the next couple of days.

Finally, we can measure the differences between the implementations more 
accurately, for example:

Measure 1: Complexity of Kernel-Classes and Traits

#('Traits' 'Kernel-Classes' ) do:[:pkgName| | pkg |
     pkg := PackageInfo named: pkgName.
     Transcript cr; show: pkg name;
         tab; show: pkg classes size;
         tab; show: pkg methods size.

Before                  Classes       Methods
Traits                    59            873
Kernel-Classes            10            468
Total                     69           1341

After                   Classes       Methods
Traits                    27(*)         188
Kernel-Classes            10            589
Total                     37(*)         777

(*) includes 17 otherwise unused compatibility traits

Measure 2: Complexity of Behavior

{Behavior. ClassDescription. Class. Metaclass}
     collect:[:each| each -> each selectors size].

Version         Behavior   ClassDescription    Class Metaclass Total
3.10              244            141             88     48     521
After             190            161             82     44     477

   - Andreas

More information about the Squeak-dev mailing list