Specializing Scope Graph Resolution Queries

Conference Paper (2022)
Author(s)

A.S. Zwaan (TU Delft - Programming Languages)

Research Group
Programming Languages
Copyright
© 2022 A.S. Zwaan
DOI related publication
https://doi.org/10.1145/3567512.3567523
More Info
expand_more
Publication Year
2022
Language
English
Copyright
© 2022 A.S. Zwaan
Research Group
Programming Languages
Pages (from-to)
121-133
ISBN (electronic)
9781450399197
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

To warrant programmer productivity, type checker results should be correct and available quickly. Correctness can be provided when a type checker implementation corresponds to a declarative type system specification. Statix is a type system specification language which achieves this by automatically deriving type checker implementations from declarative typing rules. A key feature of Statix is that it uses scope graphs for declarative specification of name resolution. However, compared to hand-written type checkers, type checkers derived from Statix specifications have sub-optimal run time performance.

In this paper, we identify and resolve a performance bottleneck in the Statix solver, namely part of the name resolution algorithm, using partial evaluation. To this end, we introduce a tailored procedural intermediate query resolution language, and provide a specializer that translates declarative queries to this language.

Evaluating this specializer by comparing type checking run time performance on three benchmarks (Apache Commons CSV, IO, and Lang3), shows that our specializer improves query resolution time up to 7.7x, which reduces the total type checking run time by 38 - 48%.