4 research outputs found
Using standard typing algorithms incrementally
Modern languages are equipped with static type checking/inference that helps programmers to keep a clean programming style and to reduce errors. However, the ever-growing size of programs and their continuous evolution require building fast and efficient analysers. A promising solution is incrementality, aiming at only re-typing the diffs, i.e. those parts of the program that change or are inserted, rather than the entire codebase. We propose an algorithmic schema that drives an incremental usage of existing, standard typing algorithms with no changes. Ours is a grey-box approach: just the shape of the input, that of the results and some domain-specific knowledge are needed to instantiate our schema. Here, we present the foundations of our approach and the conditions for its correctmess. We show it at work to derive two different incremental typing algorithms. The first type checks an imperative language to detect information flow and non-interference, and the second infers types for a functional language. We assessed our proposal on a prototypical imple- mentation of an incremental type checker. Our experiments show that using the type checker incrementally is (almost) always rewardin
Using Standard Typing Algorithms Incrementally
Modern languages are equipped with static type checking/inference that helps
programmers to keep a clean programming style and to reduce errors. However,
the ever-growing size of programs and their continuous evolution require
building fast and efficient analysers. A promising solution is incrementality,
so one only re-types those parts of the program that are new, rather than the
entire codebase. We propose an algorithmic schema driving the definition of an
incremental typing algorithm that exploits the existing, standard ones with no
changes. Ours is a grey-box approach, meaning that just the shape of the input,
that of the results and some domain-specific knowledge are needed to
instantiate our schema. Here, we present the foundations of our approach and we
show it at work to derive three different incremental typing algorithms. The
first two implement type checking and inference for a functional language. The
last one type-checks an imperative language to detect information flow and
non-interference. We assessed our proposal on a prototypical implementation of
an incremental type checker. Our experiments show that using the type checker
incrementally is (almost) always rewarding.Comment: corrected and updated; experimental results adde
Recommended from our members
Variational Typing and Its Applications
The study of variational typing originated from the problem of type inference for variational programs, which encode numerous different but related plain programs. In this dissertation, I present a sound and complete type inference algorithm for inferring types of all plain programs encoded in variational programs. The proposed algorithm runs exponentially faster than the strategy of generating all plain programs and applying type inference to them separately. I also present an error-tolerant version of variational type inference to deliver better feedback in the presence of ill-typed plain programs. All presented algorithms require various kinds of variational unification. I prove that all these problems are decidable and unitary, and I develop sound and complete unification algorithms. The idea of variational typing has many applications. As one example, I present how variational typing can be employed to improve the diagnosis of type errors in functional programs, a problem that has been extensively studied