Optional Static Typing

Robert Kern rkern at ucsd.edu
Mon Dec 27 05:18:15 CET 2004


Luis M. Gonzalez wrote:
> Robert Kern wrote:
> 
>>Automatic type inferencing is great, but sometimes the inference is
>>"object". Being able to supply more information about types helps
>>Starkiller keep the inferences tight and specific.
> 
> 
> Hmm... I'm not an expert in this subject at all, but I think that when
> the  inference is "object", as you said, is because the type couldn't
> be inferred so it defaults to object, which is the more general type of
> all.
> For example, this is what happens in Boo, which is the only language I
> know (a little bit) that uses type inference.

Starkiller, at least, can deal with cases where a variable might be one 
of a set of types and generates code for each of this set. Explicit type 
declarations can help keep these sets small and reduces the number of 
times that Starkiller needs to fall back to PyObject_* calls.

-- 
Robert Kern
rkern at ucsd.edu

"In the fields of hell where the grass grows high
  Are the graves of dreams allowed to die."
   -- Richard Harter



More information about the Python-list mailing list