Generating source code from Morphs [was: RE: More Widgets for Squeak....]

Marcel Weiher marcel at metaobject.com
Wed Feb 2 09:40:35 UTC 2000


> From: "Norton, Chris" <chrisn at Kronos.com>
> You know, I have often wished that this mechanism were more  
robust, as it is
> much easier to drag-n-drop widgets together than it is to wire  
them up the
> old fashioned way.  Perhaps the top level morph should have a standard 
> selector that can generate a method definition that can later be  
used to
> rebuild the whole thing programmatically.  Thus you could hook morphs 
> together, embed them into a SystemWindow or playfield and then ask the 
> SystemWindow to generate code that can reproduce the whole mess...  I 
> suppose the first thing to do is to implement Morph>>asSourceCode. Or 
> something like it.

What there should be is a textual representation of the  
relationships that have been created, something that is only  
implicitly supported in Smalltalk.

One way of doing this is to create Smalltalk source code, but that  
doesn't really capture the (static) relationships, but rather the  
(somewhat ad-hoc) instructions used for building it.  Such a  
representation cannot be easily manipulated in a semantically  
consistent fashion, because the only way to find out its "meaning" is  
to execute it.

Another method is to simply dump the object-graph, which is for  
example what the NeXT/Apple interface-builder does.  This has many  
advantages, but loses in that dumped object-graphs are typically not  
very human-readable/understandable/editable.

One method that seems promising is architectural description  
languages (ADLs) such as ACME from CMU.  They have direct support for  
things like "component A is connected to component B via connector C  
on (respective) ports D and E".  One of my (far too plentyful) goals  
is to embed message-sending within the conceptual framework of  
architectural connection and the language for specifying  
architectural connection within something close to present Smalltalk  
syntax.

Marcel





More information about the Squeak-dev mailing list