Python from Wise Guy's Viewpoint
Pascal Costanza
costanza at web.de
Wed Oct 29 04:27:20 EST 2003
Stephen J. Bevan wrote:
> Pascal Costanza <costanza at web.de> writes:
>
>>>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?
>>[snip]
>>Computers are fast enough and have enough memory nowadays. You are
>>talking about micro efficiency. That's not interesting anymore.
>
>
> Implement something like MD5, SHA-1, AES, ... etc. in your favourite
> language and use the fastest compiler available to you to calculate
> how many MB/s it can process. If it can get say with a factor of 2 of
> C code then IMHO you'll have proved your point. If not, then either
> your point stands but your favourite language doesn't have
> sufficiently good compilers available yet, or exact sizes are required
> in order to get good performance in this case.
Are these algorithms reason enough to have machine word sized numerical
data types as the default for a _general purpose_ language?
Pascal
More information about the Python-list
mailing list