loop in python

Fredrik Lundh fredrik at pythonware.com
Tue Aug 23 06:31:03 EDT 2005


Steve Holden wrote:

> If you want a fast language, try Holden. I've just invented it.
> Unfortunately it gets the answer to every problem wrong unless the
> answer is 42, but boy it runs quickly. The code for the whole
> interpreter (it's written in Python) follows:
>
> print 42
>
> Why are you looking for a "fast language" without any regard for the
> kind of problems you actually want (or need) to solve?

isn't measuring speed by timing for-loops a 70's thing?  I remember doing that
back when I used Z80 BASIC machines (on a 3.58 MHz machine using floating
point variables, each iteration took almost exactly 1 millisecond).

I also remember that the compiler for my first custom language for that machine
contained exactly one optimization: empty loops were replaced with plain assign-
ments.  everyone was mightly impressed.

(for another view of Python's performance, see John Walker's floating point
benchmarks: http://www.fourmilab.ch/fourmilog/archives/2005-08/000567.html
from what I can tell, Python's the fastest interpreter in that test...)

</F> 






More information about the Python-list mailing list