[Types-sig] Re: syntax and compile/run -time

John Ehresman jpe@arachne.org
Tue, 4 Jan 2000 17:05:52 -0500 (EST)


Something to think about in terms of compile / runtime is that not
all modules will be compiled at the same time.  Consider a distributed
object system which creates proxy objects on the fly so someone can
connect to a remote object and make calls on it without having a .py or
other file that corresponds to the exact interface of the remote object.
It would be nice if the following worked:

  interface HasName:
    decl name as def() -> String

  def PrintName(o as HasName) -> None:
    print o.name()

  o = ConnectToRemoteObjectThatIThinkImplementsHasName()
  PrintName(o)

Obviously this is a simplistic example, but I think what would be 
important in a more complex example is to test whether a object supports a
given interface before performing operations on it.  Both CORBA and COM
have facilities for doing this sort of thing, but it would be nice to have
a common, native way of doing this.  Actually, this brings up the question
of some sort of runtime support because the check to see if an object
supports a given interface is often delayed until some piece of code asks
for it because the check requires the name of the interface and (maybe) a
remote procedure call.

It would also be nice to be able to examine the interface of an object
through the native reflection API.  I don't know if these considerations
requre that type objects be constructable at runtime because python source
could be generated and the compiled on the fly, but I think they serve as
examples of why the type system should be extensible at runtime.

John