[Types-sig] Interface files

Paul Prescod paul@prescod.net
Wed, 15 Dec 1999 10:38:35 -0800


Greg Stein wrote:
> 
> I stated a preference for allowing this information to reside in the same
> file as the implementation. i.e. I don't want to maintain two files.

The nice thing about having separate files is that it becomes instantly
clear what is "interesting" to the compiler. We have no backwards
compatibility constraints. We have no questions about what variable are
"in scope" and "available". It's just plain simpler.

There is also something deeply elegant and useful about a separation of
interface from implementation. 

Sure, you don't always want to be REQUIRED to separate them. I
acknowledge that we will one day have to support inline declarations but
I'm going to put it off unless I hear some screaming.

> I'll go further and state that we should not use a new language for this.
> It should just be Python. (and this is where Martijn's __types__ thing
> comes in, although I'm not advocating that format)

I think that that's an unreasonable (and unreadable) constraint. The
language should probably be pythonic, but not necessarily Python. Python
doesn't have a type declaration syntax and none of Python's existing
syntax was meant to be used AS a type declaration syntax. It just gets
too unreadable for quasi-complicated declarations. We need to support
polymorphic and parameteric higher order functions!

-- 
 Paul Prescod  - ISOGEN Consulting Engineer speaking for himself
Three things to be wary of: A new kid in his prime
A man who knows the answers, and code that runs first time
http://www.geezjan.org/humor/computers/threes.html