Python from Wise Guy's Viewpoint
Pascal Costanza
costanza at web.de
Tue Oct 28 17:38:26 EST 2003
Matthias Blume wrote:
> The problem
> is that for many algorithms people want to be sure that the compiler
> represents their values in machine words. Infinite precision is
> needed sometimes, but in the majority of cases it is overkill. If you
> need infinite precision, specify the type (IntInf.int in SML's case).
> A clever compiler might optimize that like a Lisp compiler does. In
> most other cases, why take any chances?
I disagree strongly here. I am convinced that in most algorithms,
machine words don't matter at all. Have you ever seen in books on
algorithms that they actually _need_ to restrict them to values that are
representable in machine word sizes?
"Here is a proof for the correctness of the Quicksort algorithm, but
only for arrays with a maximum length of 65535." Ha! Nonsense! ;-)
Computers are fast enough and have enough memory nowadays. You are
talking about micro efficiency. That's not interesting anymore.
(but I have no problems if we agree to disagree here. we both don't have
the necessary empirical data to back our claims)
Pascal
More information about the Python-list
mailing list