Python from Wise Guy's Viewpoint

Pascal Costanza costanza at web.de
Mon Oct 27 12:14:41 EST 2003


Fergus Henderson wrote:

>>Dynamic typing works better with XP than static 
>>typing because with dynamic typing you can write unit tests without 
>>having the need to immediately write appropriate target code.
> 
> 
> That one seems to have been pretty thoroughly debunked by other responses
> in this thread.  A static type system won't stop you writing unit tests.
> And if you want to actually run the unit tests, then you are going to
> need appropriate target code, regardless of whether the system is
> statically or dynamically typed.

Not if I only want to check whether the first ten tests work, and don't 
care about the remaining ones.

>>+ Efficiency: As Paul Graham puts it, efficiency comes from profiling. 
>>In order to achieve efficiency, you need to identify the bottle-necks of 
>>your program. No amount of static checks can identify bottle-necks, you 
>>have to actually run the program to determine them.
> 
> 
> It's not enough to just identify the bottlenecks.  You have to make those
> bottlenecks go fast!  That's a lot harder with a dynamically typed language,
> because you pay a lot of overhead: greater memory usage, and hence worse
> cache performance, due to less efficient representations of types in memory;
> plus added overhead from all of those dynamic type checks.  Of course good
> compilers for dynamic languages analyze the source to try to infer the types,
> but since the language is not statically typed, such analysis will often fail.

Good dynamically typed languages provide very good options in this 
regard. However, other Lispers than me can probably provide much better 
comments on that.


Pascal

-- 
Pascal Costanza               University of Bonn
mailto:costanza at web.de        Institute of Computer Science III
http://www.pascalcostanza.de  Römerstr. 164, D-53117 Bonn (Germany)





More information about the Python-list mailing list