[squeak-dev] binary development (was: 3.11 and the trunk)

Eliot Miranda eliot.miranda at gmail.com
Tue Aug 25 04:29:34 UTC 2009


On Mon, Aug 24, 2009 at 7:35 PM, Jecel Assumpcao Jr <jecel at merlintec.com>wrote:

> K. K. Subramaniam wrote:
> > I meant a difference operator, not the diff(1) program. Change set
> browser is a
> > good tool but is incomplete. It does not track and log all changes (e.g.
> class
> > variables).
>
> I meant the same thing, but mentioned the text diff program as an
> example of what some people would like to be able to use. Back when
> Smalltalk-80 used an object table it wouldn't have been that hard to
> create a difference operator for binary images since objects never
> changed their "oop".


That only works for things that are created in exactly the same order with
no intervening operations.  If I were to compile the source for method A
followed by compiling the source for method B I would end up with different
oops for methods A and B than if I were to first compile method B's source
followed by method A's source.  Things would also be different if in between
compiling I performed some other arbitrary action that caused allocations
whose results were discarded.

The problem is orthogonal to direct pointers.


> With direct pointers it is far more complicated to
> decide that two objects in separate images are actually the same. The
> best strategy is probably to start out with classes and processes and do
> a breadth first search.


What is needed is generic structural comparison.  One problem in this is
that certain collections are unordered and therefore comparing structure
reachable from unordered collections may involve a combinatoric explosion
(compare all possible pair-wise combinations, succeeding if a match is
found).  Another problem is what I'll call incidental concrete difference.
 Are these two equivalent or not for the purposes of comparison or not?  (1
to: 3) #(1 2 3)?  (etc)

The schema for code representation in the system is well-defined and several
ordering operations exist to allow comparison; selector-method-pairs in
method dictionaries can be ordered by lexicographic order of selectors and
sibling subclasses can be ordered by lexicographic order of class names.
 Hence structural comparison of Smalltalk code is straight-forward.
 Generalising to arbitrary object structures isn't at all straight-forward
unless analogous schema are introduced.

Writing a recursive structural equality tester in Smalltalk is
straight-forward (I have code written for the Newspeak project I could post
if you're interested) but it fails for unordered collections and for
incidental concrete difference.



>
> -- Jecel
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.squeakfoundation.org/pipermail/squeak-dev/attachments/20090824/d91fa78f/attachment.htm


More information about the Squeak-dev mailing list