[Types-sig] Basic questions

Greg Stein gstein@lyra.org
Tue, 21 Dec 1999 13:11:21 -0800 (PST)

On Wed, 22 Dec 1999, skaller wrote:
> Paul Prescod wrote:
> > This is why I think that "make everything explicit" is too strong of a
> > rule in practice. I want type-checked code and untype-checked code to
> > work together more or less seamlessly. 
> 	I agree.

Me too!


[ although, strictly speaking, I'm not sure of the granularity of enabling
  type-checking, other than the presence/absence of type declarators. is
  the checking on a module level? if a function level, how do we indicate
  that? a new keyword(s)? ]

> > On the other hand, I don't want
> > to get into complicated data flow analysis. Even if someone implemented
> > it, how would we explain it to Python programmers? 
> 	But this I do not understand. When an inferencer assigns
> types to a variable of function, there are three cases:
> 	(1) the types are what the programmer expected.
> 	(2) the type is more general than the programmer expected.
> 	(3) the type is not what the programmer expected.
> 	It is only case (3) which is difficult. But, the difficulty
> is less than that which would result from a run time error, so the
> inferencing cannot reduce the programmers understanding, only
> make them realise there are bugs earlier than they might wish to
> be reminded :-)

Excellent analysis!  I heartily concur!

> 	Of course, there is a fouth case: the inferencer is 
> producing the wrong answer. This would certainly confuse the 
> programmer(s) -- probably both the client programmer and the
> author(s) of the inferencer :-)

Ssshhh! Quiet! We don't talk about that around here.


Greg Stein, http://www.lyra.org/