A lightweight namespace "proposal"

Peter van Rooijen peter at vanrooijen.com
Thu Apr 22 15:33:33 UTC 2004


goran.krampe at bluefish.se wrote:

> Hi Peter!

Hi Goran!

Thanks for your reply, I just read it all, and thanks for the many 
agreements. I believe there is a real problem to be solved by namespaces 
and I have good hopes that it is going to happen, thanks in no small 
part to your work (and I think Andreas provided much of the momentum by 
advocating an approach that places high value on simplicity).

I'm only going to give a short response now, and will probably get back 
to other individual points you made later.

> Peter van Rooijen <peter at vanrooijen.com> wrote:
[snip]
>>I really believe that it can be this simple, and that this is really 
>>useful, in this simplicity. Not having implemented it, I hope I didn't 
>>miss something that makes this proposal not work :-).
> 
> Eh... I just assumed you had looked at my implementation.

:-). I've noticed before that you often answer posts while you are 
reading them.

> You didn't touch upon the principles of rendering short names (when
> possible) in the tools and using only qualified names in the actual
> source.

Okay. My lightweight namespaces proposal *avoids* that issue entirely (I 
believe this follows from the proposal, but I did not make this point 
explicitly). The source is exactly as it is, no different rendering in 
different circumstances is required or useful. This is another way in 
which my proposal embraces simplicity. It introduces no need to modify 
the browsers or the code management system to render source differently.

I *did* elide treatment of the issue of how to compile code under the 
lightweight namespace system. Part of the reason is that I don't even 
know how code is compiled currently ;-). Perhaps currently the 
associations (bindings) are compiled into the compiled methods (can 
someone in the know answer this?).

If this is indeed the current mechanism, it requires scanning parts of 
the system for the need to recompile as class/method/pool definitions 
are added or modified. A similar approach can be used with lightweight 
namespaces.

Alternatively, one might adopt a slightly more dynamic lookup mechanism 
with extra indirection, avoiding recompilations at the cost of dynamic 
lookups. But this is all in essence an implementation detail.

Cheers,

Peter



More information about the Squeak-dev mailing list