Typing system vs. Java

Andy Freeman anamax at earthlink.net
Tue Aug 14 16:04:30 EDT 2001


Donn Cave <donn at drizzle.com> wrote in message news:<997763429.579495 at yabetcha.drizzle.com>...
> Quoth anamax at earthlink.net (Andy Freeman):
> ...
> | 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.
> 
> It's hard to compare Python vs. Haskell or OCaml and decide whose
> type system is more powerful, just because that isn't a quantifiable
> measure, but I bet your evident interest in these matters would be
> well rewarded by learning a little of one or the other.

Perhaps my distaste for static typing comes, in part, from some experience
with similar languages (ML).  Static typing has always cost me more than
the benefits I received.  (I do appreciate the "your disagreement must
stem from you ignorance" tone.)

However, I do appreciate the opportunity to restate my point explicitly.
It's pretty much useless to discuss a static type system for Python in
the abstract.  Let's see an actual proposal, complete with significant
examples (demonstrating benefits, not cleverness in writing type expressions),
and maybe even some measurements.

> The "programmers don't need all that power" argument is already
> being made, though, if you take the time to read more current
> threads in c.l.p.

Hmm - I wonder if, just maybe, those other discussions motivated/explain
why I referred to them by mentioning their argument....

> Run-time dynamism in certain aspects of the
> system is at odds with type/class unification, to questionable
> value added due to the lack of transparency (because you don't
> know even after you have seen the code - who knows what changes
> some other code may make here at run time), and the obstacles
> to optimization due to the same lack of transparency.

I'm not convinced that the type/class distinction slows down development.
I'm sympathetic to the possibility that the lack of transparency does.

The actual benefits of the optimization have been overstated.

Moreover, it's not clear that language changes are required for interesting
speedups.  Alex has mentioned ways to significantly speed up dispatch,
which happens to be one of the biggest opportunities for using type
information to increase performance.  There's also type inference, which
would improve dispatch and other things.  I've never seen anyone claim
that the bytecode interpreter is as efficient as it could reasonably be.
And so on.

While there's some work being done on python performance, it isn't getting
nearly the attention that one would expect given the opportunities if
performance really was a significant problem.  It's possible that Guido
et al's priorities are completely wrong or that they don't see the
opportunities, but ....

-andy



More information about the Python-list mailing list