Published September 12, 2022 | Version 1.0.0
Software Open

Incremental Type-Checking for Free: Artifact

  • 1. Delft University of Technology

Description

Fast analysis response times in IDEs are essential for a good editor experience. Incremental type-checking can provide that in a scalable fashion. However, existing techniques are not reusable between languages. Moreover, mutual and dynamic dependencies preclude traditional approaches to incrementality. This makes finding automatic approaches to incremental type-checking a challenging but important open question.

In this paper, we present a technique to automatically derive incremental type-checkers from Statix specifications. We use name resolution queries in scope graphs (a generic representation of name resolution embedded in Statix) to derive dependencies between compilation units. A novel query confirmation algorithm finds queries for which the answer changed due to an edit in the program. Only units with such queries require reanalysis.

 

The effectiveness of this algorithm is improved by

  1. splitting the type-checking task into a context-free and a context-sensitive part, and
  2. reusing a generic mechanism to resolve mutual dependencies.

This automatically yields incremental type-checkers for any Statix specification.

Compared to non-incremental parallel execution, we achieve speedups up to 147x on synthetic benchmarks, and up to 21x on real-world projects, with initial overheads below 10%. This suggests that our framework can provide efficient incremental type-checking to the wide range of languages supported by Statix.

Files

LICENSE.txt

Files (2.4 GB)

Name Size Download all
md5:3b83ef96387f14655fc854ddc3c6bd57
11.4 kB Preview Download
md5:fe75da1ee32f616279a1a9b96a0f7c7d
2.1 kB Preview Download
md5:402273da2d84aa7a57c1c4cec6e4b73b
2.4 GB Preview Download
md5:9f2a7c5dc9e6990b7abb2bb8086ac4b7
323.8 kB Preview Download

Additional details

Related works

Is cited by
Journal article: 10.1145/3563303 (DOI)