[Types-sig] Re: Conformance model

Paul Prescod paul@prescod.net
Wed, 29 Dec 1999 17:16:06 -0500


skaller wrote:
> 
> ...
> 
> Given that python is dynamic,
> my argument is that, say, for a type error,
> it might make sense to ... mandate that
> 
>         def f(x):
>                 1 + "Hello"
> 
> is not a valid Python program -- a compiler
> can reject the program, rather than being
> forced to implement:
> 
>         def f(x):
>                 raise TypeError
> 
> which is what is currently required.

My feeling could be summed up thus:

"The following actions are illegal. A Python compiler may report them
and refuse to compile the program or it may run the program and generate
some form of Error exception."

I would only willing to go further if you would describe overwhelming
optimization benefits in allowing undefined behavior. 

You are swimming against the tide of history here. Java doesn't have
much undefined behavior either. "Programmers these days" are more
interested in determinism than performance. Programmers are generally
more interested in optimizing coding efficiency rather than program
efficiency. Java and Python do not even array-bounds checks to be elided
even though there is no excuse for a valid program overwriting array
bounds.

 Paul Prescod