Source code or bytecode? (was Re: A little namespace "proposal")

Colin Putney cputney at wiresong.ca
Tue Apr 13 21:15:51 UTC 2004


Quoting Avi Bryant <avi at beta4.com>:

> this touches on an interesting side discussion, the answer of 
> which may well inform how we want to approach namespaces.  When we look 
> at source code for a method, what do we want to see?  I think there are 
> two useful choices:
> 
> 1. The exact string that was originally compiled to produce the current 
> CompiledMethod
> 2. A string that, if it were compiled *now*, would produce an identical 
> CompiledMethod
> 
> These are often the same thing, but not always.

Hmm. Good question. I don't have a good answer to that, except to say that I
think they should be the same thing as often as possible. 

To bring this back to namespaces, one of the things I like about my scheme is
that the only time 1 and 2 diverge is when you change the namespace for a
package - something that you do explicitly. On reflection, I suppose that
changing a package's namespace should involve updating the source to reflect
the new compilation context. 

What I dislike about Goran's proposal is that it introduces more new
opportunities for divergence between what was compiled and what will now
compile to the same bytecode. What's worse, this divergence will occur as a
side effect of actions not directly related to namespaces.

Colin





More information about the Squeak-dev mailing list