Some bizarre thoughts on the nature of programming...

Dwight Hughes dwighth at ipa.net
Wed Jun 23 00:23:01 UTC 1999


Peter,

All natural systems are heavily coupled -- it is only that the coupling
is usually indirect or mediated in some (sometimes elaborate) fashion.
Highly coupled local systems of cells and symbiotic/parasitic organisms
are the way the game is played. A few million molecules of a single
chemical released into an organism can enhance or destroy its function -
or simply make it nauseated or sleepy. Millions of very different cells
are simultaneously responding, each in its own fashion, to the exact
same "message". All organisms are constrained by their environment -
their behavior has evolved as a mechanism for dealing with this
environment, for extracting/acquiring the resources necessary to survive
and reproduce, and/or for modifying the environment around them to
enable this. Each and every organism both lives in and modifies its
environment - which changes the environment for its neighbor, who must
adapt, who now changes its own environment in every so slightly
different ways, which changes the environment for the first organism,
who must adapt,..... The most successful organisms do not simply adapt
and resist, but adapt and utilize the new resources available in the
newly changed environment. Trying to understand an organism's design and
behavior apart from its environment is like trying to understand an
airplane's function in a vacuum.

The objects and structure in Squeak can be thought of as both the
environment and the organisms within it (the separation of the two is
largely artificial anyway). Each object has certain behaviors, which
with other objects and their behaviors can begin to create their own
microenvironment - and can perform in concert with to accomplish certain
larger more complex tasks -- an application is in a sense a
multicellular organism (or an organ): the coupling inside it is tight,
the coupling outside it is much looser. But not zero - the app uses
resources from its environment - which likewise defines and constrains
much of the app's final form, appearance, and functionality -- and the
app also adds new resources to the environment by its existence, and
changes the environment a little to suit itself a bit better in the
process. The new objects and new behaviors now become a resource in the
environment for other objects and developing apps to use (like elephant
dung :-b). Refactoring simply makes the building blocks simpler and more
generally useful to other objects - other organisms; refactoring evolves
and refines behaviors. In Squeak the fundamental basis of "life" is not
DNA but _behaviors_, which are contained inside of and define objects.
Think how much faster evolution could work if discrete behaviors could
be mixed and matched, added and subtracted directly. 

The real source of hard coupling in Squeak/Smalltalk is not in the
fundamental object/message concept, nor in the class/inheritance
structure, but in the specificity of message sending - *an* object sends
*a* message to *an* object which must return *a* result. THIS is where
the limitation is. This is what makes coordinated system-wide behaviors
so difficult - why large-scale emergent behaviors from tiny low-level
behaviors are so hard to create. Objects should swim in a flowing river
of messages, responding to those they understand, ignoring those they
don't, adding their own messages to the river as they wish. Some groups
of objects - organisms/organs - surround themselves with a membrane -
filter/interface - to only allow certain sorts of messages through:
those meaningful to the organism as a whole, not its individual
parts....

I do love blue-sky conceptualizing. :-)

-- Dwight





More information about the Squeak-dev mailing list