is Missing multiple inheritance in sqeak a drawback ?

Avi Bryant squeak-dev at lists.squeakfoundation.org
Sun Oct 13 16:07:01 UTC 2002


On 13 Oct 2002, Cees de Groot wrote:

> Avi Bryant <avi at beta4.com> said:
> >What this won't do, unfortunately, is track Collection and regenerate the
> >wrappers if Collection gains or loses some methods.
> >
> These are the Perils Of Code Generation, and that's why I consider it a Tool
> of the Dark Side (the fact that you cannot write any decent system in Java
> without resorting to it says enough ;-)).

It's certainly a peril of code generation that spans encapsulation
boundaries, which is why ApsectJ still can't do incremental compilation.
Code generation within a single class works pretty well, though - for
examples, the #allAccessor generator in MetaMonkey will track instvar adds
and removes properly.  On the very ecnapsulated scale (ie, macros), I see
no problem with it at all.

It would also be quite easy to extend MetaMonkey so that classes could
notify dependents when they had changed, and solve even this problem.  I
was just being sloppy cause I was dashing it off in a couple of minutes.

> Why are you generating code and not doing something more dynamic? It'd be easy
> to have the same effect in a DNU handler.

Although I'm definitely with you that dynamic solutions should always be
the first choice, sometimes static solutions work out better.  They're
easier to debug, and integrate better with existing tools
(senders/implementors).  In this case, however, I showed a code generation
solution because that's basically what the original post asked for:
generated wrapper methods that showed  up in the browser.

Cheers,
Avi




More information about the Squeak-dev mailing list