[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the forward method [dynamic vs. static typing]




On Dec 9, 2003, at 12:26 AM, Anton van Straaten wrote:
> I don't see any of this as an argument for DT.  In a language like 
> C++, you
> can declare proxy classes to implement the interfaces you're 
> interested in
> forwarding, and in the implementation of that proxy, the methods 
> invoke the
> remoting code.  That proxy implementation can be generated via macros, 
> based
> on the same interface definition that the actual classes use.

I wrote a distributed objects system in Io in a weekend with about 2 
pages of codes - no wrappers, preprocessors, etc, required. How much 
code did the C++ implementation take? How long did it take to write? 
How complicated was the resulting system? Did new code need to be 
written every time a new class was added? If not, was as a preprocessor 
involved?

> The real disagreement we have is that I don't believe that even very 
> dynamic
> systems, in practice, are as free of assumptions about types as you 
> seem to
> imagine.  Aside from these system-level examples of proxies and the 
> like,
> can you think of common cases where you're sending messages to objects 
> where
> you don't know, even conceptually, which interface those messages 
> belong to?

Take a look at NewtonScript's inheritance system. GUI view objects 
would use their parent slots to (often) delegate unimplemented messages 
to their superviews. The result is both a powerful inheritance system 
and never knowing who might end up handling the message.

>  You're recognizing the value of static type
> systems for catching type errors involving certain kinds of values, but
> denying its value for catching errors involving other kinds of values. 
>  Are
> you sure you've analyzed that correctly?

Yes, writing a wrong value to a variable in a strongly/dynamically 
typed system is generally far easier to trace than writing the wrong 
value to a random memory location. At least in my experience.

-- Steve