Sciweavers

ECOOP
2004
Springer

Demand-Driven Type Inference with Subgoal Pruning: Trading Precision for Scalability

14 years 6 months ago
Demand-Driven Type Inference with Subgoal Pruning: Trading Precision for Scalability
After two decades of effort, type inference for dynamically typed languages scales to programs of a few tens of thousands of lines of code, but no further. For larger programs, this paper proposes using a kind of demand-driven analysis where the number of active goals is carefully restricted. To achieve this restriction, the algorithm occasionally prunes goals by giving them solutions that are trivially true and thus require no further subgoals to be solved; the previous subgoals of a newly pruned goal may often be discarded from consideration, reducing the total number of active goals. A specific algorithm DDP is described which uses this approach. An experiment on DDP shows that it infers precise types for roughly 30% to 45% of the variables in a program with hundreds of thousands of lines; the percentage varies with the choice of pruning threshold, a parameter of the algorithm. The time required varies from an average of one-tenth of one second per variable to an unknown maximum, ...
S. Alexander Spoon, Olin Shivers
Added 01 Jul 2010
Updated 01 Jul 2010
Type Conference
Year 2004
Where ECOOP
Authors S. Alexander Spoon, Olin Shivers
Comments (0)