(slightly OT): Python and linux - very cool

Michael Hudson mwh at python.net
Thu Aug 8 10:12:23 EDT 2002


Peter Hansen <peter at engcorp.com> writes:

> Michael Hudson wrote:
> > 
> > Peter Hansen <peter at engcorp.com> writes:
> > 
> > > > Actually, Python is pretty quick for an interpreted language. This is
> > > > mostly because it is a byte-code interpreter.
> > >
> > > I'd say it's mostly because the parts that really matter are mostly
> > > written in portable C code.  Python is pretty quick in general, not
> > > just for interpreted languages.
> > 
> > This depends what you're doing.  Slicing and dicing strings, making
> > network connections, etc., yes.  Doing something that relies on fast
> > integer math, and performance begins to hurt.  Use the tool for the
> > job, etc.
> 
> I thought it was fairly well established at this point that Numeric
> and friends allowed such things with fairly high performance.  Now
> if you need lots of little random manipulations that those packages
> can't help you with, I would agree.

That's the problem I had.  In general, I think that it's important to
counteract the "Oh my God it's interpreted it's too slow" reaction,
but at the same time it's worth realising that there are situations
where it will hurt.

For the problem I had, using C to speed up the project would have
probably meant that my script would have gone:

import c_bit
c_bit.run()

and that's no fun.  I wrote the solution in Haskell in the end, and
threw ghc at it...

> Anyway, "in general" means in general, so naturally there are 
> exceptions.

I've being doing enough algebraic geometry of late for "in general" to
mean something disturbingly precise... "The space of problems where
Python's speed is a problem is Zariski closed?  Wow!"

Cheers,
M.

-- 
  I'd certainly be shocked to discover a consensus.  ;-)
                                      -- Aahz Maruch, comp.lang.python



More information about the Python-list mailing list