Python from Wise Guy's Viewpoint

Fergus Henderson fjh at cs.mu.oz.au
Sat Nov 1 08:44:10 EST 2003


prunesquallor at comcast.net writes:

>Fergus Henderson <fjh at cs.mu.oz.au> writes:
>
>> But the difference between dynamically typed languages and
>> statically typed languages is that in dynamically typed languages, *every*
>> data access (other than just copying data around) involves a dynamic dispatch.
>> Sure, implementations can optimize a lot of them away.  But generally you're
>> still left lots that your implementation can't optimize away, but which
>> would not be present in a statically typed language, such as the O(N)
>> dynamic type checks in the example above.
>
>That's what the type-checking hardware is for.

Did you forget a smiley?

In case not: type-checking hardware has been tried already, and failed.

(Anyway, type-checking hardware would only solve part of the problem, I think.
Dynamic type checking imposes two costs: one is the time cost of performing
the checks, and the other is the locality cost due to the code size increase.
Type-checking hardware avoids the code size increases, but I don't think it
helps with the time cost of performing the checks.)

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.




More information about the Python-list mailing list