[squeak-dev] SimpleMorphic

Miguel Cobá miguel.coba at gmail.com
Sat Mar 5 05:20:53 UTC 2011


Great work, thanks.

A suggestion, why don't follow a common pattern to name the
Pharo/Squeak/Gemstone specific code for package XXX with the format:

XXX-Squeak

so that the packages be:

XXX-dtl.123.mcz
XXX-Squeak-dtl.123.mcz
XXX-Pharo-dtl.123.mcz

This way if a Metacello configuration is created for this package it
will pull the corresponding dependency for tha platform where is being
installed.

Cheers.


El vie, 04-03-2011 a las 18:41 -0500, David T. Lewis escribió:
> On Wed, Nov 10, 2010 at 02:46:54PM -0300, Juan Vuletich wrote:
> > Hi Folks,
> > 
> > A few days ago I released SimpleMorphic for Pharo. SimpleMorphic is the 
> > Morphic implementation in Cuis. It is much smaller and simpler than the 
> > one in Pharo (and in Squeak). Please see 
> > http://lists.gforge.inria.fr/pipermail/pharo-project/2010-November/035302.html 
> > . A link to the code (for Pharo 1.2) is included.
> > 
> > While this release of the code is for Pharo, it shouldn't be a big deal 
> > to make it run on Squeak. My hope is that the Pharo community studies it 
> > in detail, adopts it, and eventually remove the old Morphic. For Squeak, 
> > maybe the same happens. Or perhaps there would be 2 Morphic UIs for 
> > Squeak: FullMorphic+Etoys and SimpleMorphic... So, what do you think?
> 
> Many thanks to Juan for creating SimpleMorphic, and thanks also to ESUG
> for supporting his work to make SimpleMorphic available to the community.
> 
> To load SimpleMorphic into a fully updated trunk image, install the
> following from the Squeak inbox:
> 
> 	Morphic-dtl.523.mcz
> 	SMx-dtl.12
> 	SimpleMorphic-dtl.7
> 
> After loading these three files, you can open a new SimpleMorphic project
> from the menu bar or from the world menu. Not everything works yet, but
> there is enough in place to open browsers, workspaces, etc and generally
> get a feel for how it works.
> 
> Notes:
> 
> This is based on the original distribution for Pharo:
> http://pharo.googlecode.com/issues/attachment?aid=6793947083037793423&name=SimpleMorphicR01.zip&token=0e3d443e10d0d5a6d8239158ec9e273d
> 
> I attempted to preserve the SimpleMorphic package with as few changes as
> possible, and ended up with a SimpleMorphic package and an SMx support
> package, where all of the Squeak-specific changes are in SMx. The Project
> and ToolBuilder classes are modified copies of the Morphic versions, with
> no attempt to refactor or clean up unnecessary code (this can be done later,
> as the intent is to make SimpleMorphic available in a form as close as
> possible to the original distribution).
> 
> All of the development MCZ files are on my hard disk, and I can copy
> them either to SqueakSource or to squeak.org if there is an interest
> (not sure what to do with this, suggestions welcome).
> 
> The SimpleMorphic and SMx packages are entirely self-contained, and
> can be loaded and unloaded without affecting the normal Morphic or MVC
> environments:
> 
> 	(MCPackage named: 'SMx') unload.
> 	(MCPackage named: 'SimpleMorphic') unload.
> 
> Dave
> 
> 
> > 
> > I also sent this comment to the Pharo mail list recently, trying to make 
> > clear why SimpleMorphic is useful:
> > 
> > "Size of 4 core classes (Morph, MorphExtension, PasteUpMorph and 
> > WorldState)
> > Pharo / Squeak / Cuis
> > totalIvars:  39 / 46 / 26
> > totalClassVars: 15 / 10 / 5
> > totalInstMethods: 1170 / 1764 / 663
> > totalClassMethods: 55 / 71 / 16
> > 
> > Size of the whole Morph hierarchy
> > Pharo / Squeak / Cuis
> > totalClasses: 197 / 331 / 58
> > totalIvars:  649 / 1063 / 257
> > totalClassVars: 54 / 138 / 28
> > totalInstMethods: 6651 / 9186 / 2115
> > totalClassMethods: 303 / 858 / 127
> > 
> > SimpleMorphic is much smaller. Core classes are simpler and easier to 
> > understand, fix and extend. The most important part is that this is not 
> > blind removal of unused code. A lot of the functionality has been 
> > redesigned to make it simpler, and the removal was done with great care 
> > to result in a consistent system. This work started in 2004, so we're 
> > talking of about 6 years of careful work. All this means that 
> > SimpleMorphic does not support all the features that Pharo or Squeak 
> > might support. Please use the browsers and other tools in Cuis to check 
> > what it indeed can do.
> > 
> > Talking about complexity, let's take for example, morph layout. This is 
> > started with #doLayoutIn: in Pharo and #doLayoutIfNeeded in SimpleMorphic.
> > 
> > In Pharo, this method calls #adjustLayoutBounds: (19), #layout:in: 
> > (149), #layoutProportionallyIn: (10), 
> > #computeCellArrangement:in:horizontal:target: (87), 
> > #computeGlobalCellArrangement:in:horizontal:wrap:spacing: (31), 
> > #computeCellSizes:in:horizontal: (30), 
> > #computeExtraSpacing:in:horizontal:target: (136), #layoutLeftToRight:in: 
> > (91), #layoutTopToBottom:in: (91), #placeCells:in:horizontal:target: 
> > (70). The numbers in parenthesis are the sum of the lines of code of the 
> > implementors. Total lines of code for layout (taking only these most 
> > important methods) is 714. I doubt there are many people who really 
> > understand all of this code.
> > 
> > In SimpleMorphic (Cuis), this calls #layoutSubmorphsIn: (10), 
> > #applyLayoutFrameIn: (11), #layout:in: (24). Total lines of code is 45. 
> > I believe any smalltalker could understand these in just minutes."
> > 
> > Cheers,
> > Juan Vuletich
> 

-- 
Miguel Cobá
http://twitter.com/MiguelCobaMtz
http://miguel.leugim.com.mx






More information about the Squeak-dev mailing list