A fully late bound namespace proposal

Igor Stasenko siguctua at gmail.com
Thu Oct 4 16:23:07 UTC 2007


On 04/10/2007, Andreas Raab <andreas.raab at gmx.de> wrote:
> Göran Krampe wrote:
> > One way to do this is to compile a global ref as a message send so that:
> >
> >    Array
> >
> > ...compiles *as if* it said:
> >
> >    Smalltalk resolve: #Array
> >
> > ...or something similar. Then we can actually dynamically figure out if it
> > should evaluate to "good old Array" or "Jim's new cooler Array" depending
> > on for example the PI of the sender or any current remappings or whatever!
>
> This is trivial to do but unfortunately it doesn't solve *any* real
> problems. But it creates new ones: For example, access to classes would
> suddenly be slowed down by 100x or more and you'd have to be very
> careful where and how you use classes (no use in tight loops for
> example) then creating new kinds of references (in iVars etc) that the
> compilers don't know about and can't fix when recompiling stuff.
>
We could add to class protocol a message like #updateReferences
to inform compiled class that it must update its external references, if any.
I don't see the really big problems with late bound name resolution.
It will shift some of the programming techniques, and some of them in
really good way, like code/behavior locality, solving naming conflicts
e.t.c.
And default name resolution was proposed only for backward compatibility.


> This has always been my problem with these late bound proposals: They
> sound nice, but they do not solve any actual problem that their
> proponents can point to, and everyone will be paying the price for a
> horribly slow lookup of classes. Bad tradeoffs.
>
> Cheers,
>    - Andreas
>
>


-- 
Best regards,
Igor Stasenko AKA sig.


More information about the Squeak-dev mailing list