Python from Wise Guy's Viewpoint

Pascal Costanza costanza at web.de
Thu Oct 23 12:20:14 EDT 2003


Simon Helsen wrote:
> On Thu, 23 Oct 2003, Remi Vanicat wrote:
> 
> 
>>>How does ocaml make sure that you don't get a message-not-understood
>>>exception at runtime then?
>>
>>It make the verification when you call the test. I explain :
>>
>>you could define :
>>
>>let f x = x #foo
>>
>>which is a function taking an object x and calling its method
>>foo, even if there is no class having such a method.
>>
>>When sometime latter you do a :
>>
>>f bar
>>
>>then, and only then the compiler verify that the bar object have a foo
>>method.
> 
> 
> you might want to mention that this is possible because of 'extensible
> record types'. Well, there is a good chance the pyhton/lisp community will
> not understand this, but it illustrates that a lot of the arguments
> (probably on both sides in fact) are based on ignorance.

Do you have a reference for extensible record types. Google comes up, 
among other things, with Modula-3, and I am pretty sure that's not what 
you mean.

> One more thing I remembered from a heavy cross-group fight between
> comp.lang.smalltalk and c.l.f. quite a while ago, is that so-called
> 'dynamically typed' languages are useful because they allow you to
> incrementally develop ill-typed programs into better-typed programs (the
> XP-way), where the ill-typed programs already (partially) work.

Sometimes the ill-typed program is all I need because it helps me to 
solve a problem that is covered by that program nonetheless.

> OTOH, with
> a static type system, you have to think more in advance to get the types
> right. XP-people consider this a hindrance and that is what people mean
> with 'the type system getting the way'. With a Haskell-style or even
> Ocaml-style type system, you cannot seriously argue that you can write a
> program which cannot be easily(!) converted into one that fits such type
> systems. By program, I mean 'a finished production-reade piece of
> software', not a 'snapshot' in the development cycle.
> 
> The arguments from the smalltalk people are arguably defendable and this
> is why this kind of discussion will pop up again and again. Using either
> static or dynamic (Blume: untyped) type systems is not the point at all.
> What actually matters is your development style/phylosophy and this is
> more an issue of software engineering really.

Exactly. Very well put!

Thanks,
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