Typing system vs. Java

Andy Freeman anamax at earthlink.net
Fri Aug 10 18:07:01 EDT 2001


Christopher Barber <cbarber at curl.com> wrote in message news:<psoy9os5a88.fsf at jekyll.curl.com>...
> "Alex Martelli" <aleaxit at yahoo.com> writes:
> > Applications whose "performance bottleneck" is _100%_ of their code?!
> > Never heard of any such thing.  10% to 20% seems to be common.  What
> > counter-examples do you have in mind?
> 
> Not a bottleneck, but a continuous degredation of performance across the
> entire application due to memory use, overhead for method dispatching, etc.
> This situation is only likely to happen in very large OO applications.

"continuous degradation" doesn't matter outside places that aren't
performance critical.  For example, code that waits for humans can
be quite "degraded" before it matters at all.

This is why I mentioned inappropriate attention to performance earlier.

> There are also deployment situations where you might not be allowed to make
> use of C extensions.

You could deploy C.  You could deploy Python (which has numerous
standard extensions).  However, you can't deploy Python plus C extensions.

Many things can happen.  However, only a small fraction happen often enough
to worry about.

I realize that some situations come with arbitrary and nonsense restrictions.
I've found that when faced with such a situation, the appropriate response is
usually to find a new situation.  Regardless of the correctness of my
evaluation, that response improves things for everyone.

> > Not by itself, surely -- but, when using Python together with lower-level
> > languages for that 10% to 20% of code whose speed really matters, I
> > can't easily think of examples.
> 
> But why can't Python be fast enough without resorting to extensions?  Forcing
> users to learn C in order to make their Python code fast detracts from
> Python's advantage as a simple, easy-to-use language.

Of course, there's another alternative - with Python's development time
advantages, they'll have more time to come up with better algorithms, so
they may not need the extension.

> personally don't think that type declarations would add much complexity, but I
> guess I can see how someone new to them might be confused.

You must have missed a post or two.  If they're required, they either aren't
adequate, or they are complex, or both (C).

> Of course, that same person would be lost once they had to learn C.

And maybe they'll never have reason to learn C.  I suspect that a fair
number of SQL programmers don't.  I'm sure that many Excel programmers
don't.  Yet, both are able to write programs.  Why is it reasonable to
assume that a Python programmer will need to know C?

If you think that type declarations are important, you know where to find
them.

Remember - Python can't be better (or worse) than C without being different
from C.

-andy



More information about the Python-list mailing list