llst icon indicating copy to clipboard operation
llst copied to clipboard

Research the possibilities of statistically assisted type inference

Open 0x7CFE opened this issue 11 years ago • 0 comments

In statically typed environments Hindley-Milner algorithm may be used to infer the types of expression depending on it's parts. The question is, may this idea be applied to the Smalltalk's pure dynamic environment?

In case of JIT VM we have statistics of which call site affect what classes and potentionally object of what class is returned. Gathering this information we may find a places (call sites and methods) with classes tightly bound to one or more variables. If particular variable appeared to have only one class during the whole runtime, we may then perform an optimization that assumes that current variable always have this class. Thus, specializing the method. Inside, we may treat class as a statically assigned type. This allows us to apply type infering where it is possible.

0x7CFE avatar Sep 16 '13 17:09 0x7CFE