[Types-sig] Re: Inferencing: A case study

Paul Prescod paul@prescod.net
Tue, 14 Dec 1999 08:07:12 -0800


Guido van Rossum wrote:
> 
> Here's a long and rambling example of what I think a type inferencer
> could do -- without type declarations of any sort.  I wrote this down
> while thinking about the type checker that I would like to see in
> IDLE.

Okay, but let me ask this: if TOTAL Java-level type safety ONLY required
type declarations for all "non-local" variables (including functions and
instance variables) would that be acceptable to you?

Your inferencer heuristics are fine for an interactive GUI environment
where failure is merely an inconvenience but if we are going to have a
formally checkable notion of "this is statically type-safe" and "this is
not" then I worry about the "non-local breakage" problem. Oops, did
changing that variable to an "int" break your module way over there?

I spoke to the Journal of Functional Programmers at a conference
recently. I asked him about why ML's type inferencer made the language
so hard to use. He said: "oh, you should always put the type
declarations in. The type inferencer is mostly just an educational
tool." Of course that's not what the type inferencer was SUPPOSED to be,
but I think that that's what it has become. "Global" type inferencing
scares me and I think that it has the unintended consequence of making
the static type checker (and thus the language) harder to understand.

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