Title :
Static Type Analysis for Python
Author :
Tiancong Dong ; Lin Chen ; Zhaogui Xu ; Bin Yu
Author_Institution :
State Key Lab. for Novel Software Technol., Nanjing Univ., Nanjing, China
Abstract :
Python is a kind of dynamic-typed language which provides flexibility but leaves the programmer without the benefits of static typing. This paper describes Type, a tool that works for static type annotation and inference for python. It could simulate the built-in modules, transform the Python source code to IR(Intermediate representation) which we design and annotate, infer and reduce the IR into the type system. Type could provide the explicit type information, detect the type errors at compile time and improve the efficiency of development and the accuracy of point-to analysis. By the evaluation of applying Type to a suite of benchmarks, we find that Type can annotate and infer the types with a good precision and coverage in accept time.
Keywords :
high level languages; program diagnostics; source code (software); IR; Python source code; Type; dynamic-typed language; intermediate representation; point-to analysis; static type analysis; static type annotation; type error detection; Algorithm design and analysis; Context; Heuristic algorithms; Inference algorithms; Libraries; Standards; Transforms; Python; type analysis; type annotation; type inference;
Conference_Titel :
Web Information System and Application Conference (WISA), 2014 11th
Print_ISBN :
978-1-4799-5726-2
DOI :
10.1109/WISA.2014.20