Why does Dynamic Typing really matter?!?

Alex Martelli aleax at aleax.it
Thu Feb 6 19:36:24 EST 2003


Jeremy Fincher wrote:
   ...
>> as Maoist rhetoric:  we support dynamic typing not to change
>> types, but to ignore types.  Types are a false overdetermin-
   ...
> That's not an argument against static typing, it's an argument against
> explicit typing.  An implicitly statically typed language (one that
> infers types at compile time, like ML) allows you to "ignore types" as
> well as providing static assurance of type safety.

To SOME extent.  Haskell does, thanks to typeclasses, more than
SML.  CAML and O'CAML reduces polymorphism to the point that
you have to write +. when adding floats, vs + when addint ints --
to claim that this lets you ignore types is ridiculous.

How much signature based polymorphism does the language
support?  That is one key question.  Haskell potentially offers a
lot, if you get your typeclasses right; various ML dialects offer
less, or none at all -- not supporting the concept of "classes of
types" (Haskell's typeclasses), they thereby don't let functions
you code be all that generic (except maybe in a few limit cases
such as SML supporting + on both floats and ints by special
casing).  Type inference is good, but without typeclasses it does
not offer all that much over plain type declarations.  WITH some
typeclass concept, it gets similar advantages to C++'s templates
(a bit better in some ways, a bit inferior in others, but overall
about as useful IMHO).  Python happens to be yet smoother
(though it COULD use the concept of a typeclass or protocol
and adaptation thereto -- there's a PEP about that...).


Alex





More information about the Python-list mailing list