Optional Static Typing - Haskell?

Alex Martelli aleaxit at yahoo.com
Sun Dec 26 10:59:57 CET 2004


Mike Meyer <mwm at mired.org> wrote:

> aleaxit at yahoo.com (Alex Martelli) writes:
> 
> > Mind you, I personally _like_ the concept of describing
> > an interface separately, even in a different language (Corba's IDL, say)
> > that's specialized for the task.  But it doesn't seem to be all that
> > popular... without such separation, modularity plus static checking
> > appears to imply bottom->up coding: you need to compile modules in some
> > topologically sorted order compatible with the "X uses Y" relation.
> 
> Personally, I hate declaring the interface separately, whether in the
> same language or another language. 

Yeah, so do many people -- as I mentioned, it's not all that popular.
Personally, I don't see _why_, but there's no doubt that the market is
speaking quite loudly in this respect; the concept of using IDL is seen
as a handicap of (e.g.) Corba and pure COM (while I agree with Don Box's
lavish _praise_ for that concept in a COM context!), and the concept of
not having an interface separate from the implementation is touted as a
plus of (e.g.) Java vs C++.

But then, the above criticism applies: if interface and implementation
of a module are tightly coupled, you can't really do fully modular
programming AND static typing (forget type inferencing...).


> On the other hand, generating the
> interface information from the code for type checking (and
> documentation) purposes makes an incredible amount of sense. A type
> inferencing engine to generate that information from Python code -
> with possible a bit of human assistance - would make it possible to
> use pychecker to catch duck typing errors without having to import an
> entire module.

And why should it be a problem to "import an entire module", pray?  I
just fail to see any BIG advantage here.  Sure, you could extend pydoc
to generate a bit more docs than it already does -- big deal.  How much
would that augment your overall productivity?  5%?  10%?  Some tiny
incremental amount, anyway.  If it prompts you to do less unit testing,
it might even have a negative lifecycle-productivity impact;-).


Alex



More information about the Python-list mailing list