Typing system vs. Java

Andy Freeman anamax at earthlink.net
Mon Aug 13 19:41:31 EDT 2001


Christopher Barber <cbarber at curl.com> wrote:
> anamax at earthlink.net (Andy Freeman) writes:

> Sure.  In many cases that will be true, but I thought we were talking about
> the other cases here.

Since I don't believe that a single language can suit all purposes,
I don't see the point in worrying about all cases.

> > You must have missed a post or two.  If they're required, they either aren't
> > adequate, or they are complex, or both (C).
> 
> Even if required, I don't think that type declarations add that much
> complexity.

While it may be possible that type delarations doesn't "need" to add
significant complexity to understanding a language, I haven't seen any
supporting evidence.  All available evidence/experience points the other
way.

I also note that you ignored the adequacy problem.  Simple type systems
are notoriously inadequate, and they usually turn out to be complex in
subtle ways, which is arguably worse, because they lull people into
hard to handle mistakes.

Python's type system has some marvelous properties.  Feel free to
produce a static type system that is as powerful.  Then you get to
make the complexity argument.  Or, you get to make the "but programmers
don't need all that power" argument.  Or both.

  They would definitely not have any affect on the standard
> complexity metrics.  To me complexity has to do with the number of
> interconnections in your program and adding type information does
> not change that, and could in fact lower it by preventing certain
> relationships.

Static type declarations must increase the number of interconnections.
If they don't, they can't support error detection, among other things.

> It would make the language as a whole larger, and therefore more difficult to
> assimilate for programmers, but that is not quite the same thing.

So, instead of learning Alex's idioms, programmers learn type declaration
trivia.  That's a horrible trade.

> I am asking about what can
> be done about the wall that developers will hit when they *can't* get
> sufficient performance: either they will have to resort to C extensions or
> switch to another language; in either case they will have to learn a different
> language.

Interestingly enough, few of the small minority who run into that wall
seem as concerned as you.  Perhaps, on the whole, Python's tradeoff
actually is acceptable to them.

One of the bad things about Python (and almost all non-lisp languages)
is that it doesn't lend itself to easily defining new languages that
are "minor" variations on existing ones.  That's a shame.

-andy



More information about the Python-list mailing list