Python from Wise Guy's Viewpoint

Matthias Blume find at my.address.elsewhere
Tue Oct 28 18:43:53 EST 2003


Pascal Costanza <costanza at web.de> writes:

> Matthias Blume wrote:
> 
> > Pascal Costanza <costanza at web.de> writes:
> 
> >>I think that Neelakantan has better examples for programs that are
> >>possible to write with a statically typed language, but not with
> >>dynamically typed ones. (Not 100% sure yet, though.)
> > There are no such programs, obviously.  You can always translate a
> 
> > statically typed program into a dynamically typed one (and vice
> > versa).
> 
> No, for christ's sake! There are dynamically typed programs that you
> cannot translate into statically typed ones!

Yes you can.  (In the worst case scenario you lose all the benefits of
static typing.  But a translation is *always* possible. After all,
dynamically typed programs are already statically typed in the trival
"one type fits all" sense.)

> Yes, these things are all obvious. But these are not examples for an
> increase of expressive power! These are only examples of _restricting_
> the set of potentially useful programs! How hard is this to
> understand?
>
> You _want_ this restriction. Why don't you _admit_ that it is a restriction?

Who said that I don't admit that I want restrictions.  That's the
whole point.  Static typing increases my expressive power because I
can now *express restrictions* which I couldn't express before.
That's the whole point.  Being able to express more programs is not
the issue, being able to express more restrictions and being told
early about their violations is!

[This whole discussion is entirely due to a mismatch of our notions of
what constitutes expressive power.]

Matthias




More information about the Python-list mailing list