[Types-sig] Implementability

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

I was wondering when our Professional Compiler Writer and resident
skeptic would jump in and tell us what we were doing wrong! Thanks.

Tim Peters wrote:
> ...
> So your intuition is on the right track here.  What I can add as a former
> Professional Compiler Writer is my Professional Assurance that making this
> all run efficiently (in either time or space) is a Professional Pain in the
> Professional Ass.  

According to the principle of "from each according to their talents" you
should be writing this optimizing, static type checker.

> Because of this, global analysis never works out in
> practice unless you invent an efficient database format to cache the results
> of analysis, keeping that in synch with the source base under mutation.

Bah. The scope of compilation is the module. The scope of inference is a
namespace defining suite (e.g. a module, class body or method, but not
an "if" or "try").

> It's all too easy to come up with a toy system that absolutely will not
> scale to real life!  Python has an advantage, though, in that most people
> write very small functions and methods most of the time.  If you can, in
> addition, avoiding needing to deduce the types of most globals, it could
> actually fly before we're all dead <wink>.

The types of globals from other modules should be explicitly declared.
If they aren't, they are presumed to have type PyObject or to return
PyObject. Or they just aren't available if you are in strict static type
check mode.

 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