Context-Sensitive Abstract Interpretation of Dynamic Languages
Franciszek Piszcz
TL;DR
The thesis targets the tooling gap between static and dynamic languages by proposing a context-sensitive abstract interpretation framework for dynamic languages. It develops TinyScript, a minimal JavaScript subset, and its closure-converted intermediate form to enable precise static analysis of dynamic features such as metaprogramming and runtime reflection. The core contribution is a context-sensitive analysis with heap specialization that yields precise control/data-flow information, along with a practical prototype implemented in Rust. This work lays the groundwork for improving IDE features like navigation, autocompletion, and refactoring in dynamic languages, with a path toward scaling to real-world JavaScript and Python codebases through incremental, on-demand analysis. The approach demonstrates that advanced static analyses can bridge the gap between dynamism and tooling, enabling more reliable developer workflows in dynamic-language ecosystems.
Abstract
There is a vast gap in the quality of IDE tooling between static languages like Java and dynamic languages like Python or JavaScript. Modern frameworks and libraries in these languages heavily use their dynamic capabilities to achieve the best ergonomics and readability. This has a side effect of making the current generation of IDEs blind to control flow and data flow, which often breaks navigation, autocompletion and refactoring. In this thesis we propose an algorithm that can bridge this gap between tooling for dynamic and static languages by statically analyzing dynamic metaprogramming and runtime reflection in programs. We use a technique called abstract interpretation to partially execute programs and extract information that is usually only available at runtime. Our algorithm has been implemented in a prototype analyzer that can analyze programs written in a subset of JavaScript.
