Namespace issues

Jason Marshall
Sun, 09 Apr 2000 22:38:37 PDT

>A solution I had proposed for my OS was to have an interface by which
>implementations can talk to each other.... You call the "upgrade" 
function on
>the old module and it will return a "This is what I am thinking" in 
>standardized dialect. Then the new implementation sets up its state 
and saves
>all the instances in its own format and then shuts down the old 

Yeah, I was thinking that one could have two persisted formats, one 
public (conforming to a contract), and one private to the 
implementation.  In situations where the state at next use will be 
indeterminant (for instance, long-term storage, broadcast of the data, 
system upgrade, whatever), one will either have to a) store the public 
format, or b) store the private format and a translator to the public 
format.  For large datasets, b will most likely win out due to 
amortization of the logic storage costs (for instance, storing the 
OED2), but for small sets, the standard format would likely win out.  

The public format may well be something like XML, and the private 
format could use whatever level of bit-twiddling that is considered 
appropriate to the implementors.

But by always converting the data to your local concept of the module, 
you avoid having two versions 'on accident' in this way.   You could 
still choose to do so, if you like, and I definitely would like.  That 
comes in handy when you have a module that you need to be dynamic, such 
as is common with reloadable web server modules, dynamically generated 
data handlers, or when one would like to write a debugger in the same 
language one is debugging.  In these situations, you need or would like 
to be able to 'forget' prior knowledge of code and rediscover a 
different definition of it.