Needless copying in iterations?

Steven D'Aprano steve at REMOVE-THIS-cybersource.com.au
Sun Sep 16 09:31:57 EDT 2007


On Sun, 16 Sep 2007 10:58:07 +0000, Marc 'BlackJack' Rintsch wrote:

> On Sun, 16 Sep 2007 09:50:39 +0000, Steven D'Aprano wrote:
> 
>> The point is rather moot, since CPython (and probably other Pythons) do
>> almost no optimizations. But just because Python is a dynamic language
>> doesn't mean there are no optimizations possible: Haskell is a dynamic
>> language, and there are optimizing compilers for it. Of course, it is
>> much simpler for Haskell, because of the type system it uses.
> 
> What do you mean by Haskell is a dynamic language?  It is statically and
> strict typed and the compiler usually knows all the functions.  No
> "surprises", no side effects, no duck typing.

Haskell's IO monad (and possibly the do monad?) allows side effects. It 
would be a pretty poor programming language that didn't allow input or 
output!

See also http://homepages.cwi.nl/~ralf/OOHaskell/
showing that Haskell can do object-oriented programming, complete with 
mutable objects and side-effects. Although "duck typing" is listed as a 
keyword, I couldn't see any reference to it in the paper.

Haskell uses type inference, and has a "maybe" type for those cases where 
it can't tell what the type will be.

If you still don't accept that Haskell is a dynamic language, for 
whatever definition of dynamic language you use, I'll withdraw the claim 
for the sake of not getting bogged down in long arguments over something 
that was really just a minor point.


-- 
Steven.



More information about the Python-list mailing list