Python from Wise Guy's Viewpoint
costanza at web.de
Sat Oct 25 00:24:51 CEST 2003
Marshall Spight wrote:
>>>It would be really interesting to see a small but useful example
>>>of a program that will not pass a statically typed language.
>>>It seems to me that how easy it is to generate such programs
>>>will be an interesting metric.
>>>Anyone? (Sorry, I'm a static typing guy, so my brain is
>>>warped away from such programs. :-)
>>Have you ever used a program that has required you to enter a number?
>>The check whether you have really typed a number is a dynamic check, right?
> This is not an example of what I requested. I can easily write
> a statically typed program that inputs a string, and converts
> it to a number, possibly failing if the string does not parse to a number.
...and what does it do when it fails?
> I was asking for a small, useful program that *cannot* be written
> in a statically compiled language (i.e., that cannot statically
> be proven type-correct.) I'd be very interested to see such
> a thing.
I have given this example in another post. Please bear in mind that
expressive power is not the same thing as Turing equivalence.
I have given an example of a program that behaves well and cannot be
statically typechecked. I don't need any more evidence than that for my
point. If you ask for more then you haven't gotten my point.
Pascal Costanza University of Bonn
mailto:costanza at web.de Institute of Computer Science III
http://www.pascalcostanza.de Römerstr. 164, D-53117 Bonn (Germany)
More information about the Python-list