Python from Wise Guy's Viewpoint

Marshall Spight mspight at dnai.com
Fri Oct 24 18:51:30 EDT 2003


"Pascal Costanza" <costanza at web.de> wrote in message news:bnc8rk$pvk$1 at f1node01.rhrz.uni-bonn.de...
> 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?

What it does when it fails is irrelevant to my request
for someone to come up with a small, useful program
that cannot be written in a statically typed language,
since the program you describe can easily be written
in any statically typed language I'm aware of.

I'm perfectly aware of the fact that statically typed languages
have some runtime checks. This is a feature that static
and dynamic languages have in common, so I don't
see what you might be trying to get at.


> > 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.

I'm very sorry, but I didn't see it. Could you help me find it?


> Please bear in mind that
> expressive power is not the same thing as Turing equivalence.

No prob.


> 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.

I'm not asking for more; I'm asking to see the program you're referring to.

Also, I was under the impression that this subthread is about
*my* point, which was a request for a small, useful program
that cannot be written in a statically typed language.


Marshall






More information about the Python-list mailing list