Computer Science Technical Reports
Permanent URI for this collection
Browse
Browsing Computer Science Technical Reports by Author "Allen, Eric"
Now showing 1 - 2 of 2
Results Per Page
Sort Options
Item Object-Oriented Type Inference for Telescoping Languages(2004) Allen, Eric; Kennedy, Ken; McCosh, CherylThe telescoping-languages approach achieves high performance from applications encoded as high-level scripts. The core idea is to pre-compile underlying libraries to generate multiple variants optimized for use indifferent possible contexts including different argument types. We have previously developed a type inference algorithm that enables type-based specialization. The algorithm infers types over untyped library procedures before actual inputs are known. Type inference is necessary both to determine the minimum number of variants needed to handle all possible uses of the library procedure as well as to statically determine, for each variant, which optimized implementations should be dispatched at each call location. In this paper, we extend the type inference algorithm to handle user-defined types in an object-oriented scripting language such as Python. Variants will be generated in order to eliminate dynamic dispatch where possible. This will allow for faster runtimes as well as enable more cross-method optimizations. Two problems that arise when handling user-defined types are the lack of abound on the number of types and the possibility of extensions to the type hierarchy after type inference. We address these problems and describe the type inference solution.Item Static Type Inference for Specialization in a Telescoping Compiler(2004-09-01) Allen, Eric; Kennedy, Ken; McCosh, Cheryl; Taha, WalidThe telescoping languages approach achieves high performance from applications encoded as high-level scripts. The core idea is to pre-compile underlying libraries to generate multiple variants optimized for use indifferent possible contexts including different argument types. This paper proposes a type inference algorithm that enables this kind of specialization. The algorithm infers types over untyped library procedures before actual inputs are known. For our Matlab compiler, the notion of type captures matrix properties such as size, sparsity pattern, and data type. Type inference is necessary both to determine the minimum number of variants needed to handle all possible uses of the library procedure as well as to statically determine, for each variant, which optimized implementations should be dispatched at each call location. A key contribution that arose from this work is a notion of mutually exclusive types. To illustrate these types, we formalize the underlying type system, constraint-collection, and solution. Finally, we prove that the algorithm is polynomial under practical conditions.