论文标题
专门范围图分辨率查询:扩展版
Specializing Scope Graph Resolution Queries: Extended Edition
论文作者
论文摘要
为了保证程序员的生产力,类型的检查器结果应该是正确的,并且可以迅速可用。当类型检查器实现对应于声明类型的系统规范时,可以提供正确性。 STATIX是一种类型的系统规范语言,它通过自动从声明性打字规则中派生类型的Checker实现来实现此目的。 STATIX的一个关键功能是它使用范围图来进行名称分辨率的声明规范。但是,与手写类型的检查器相比,从Statix规格中派生的调查器具有次优的运行时间性能。 在本文中,我们使用部分评估在Statix求解器中识别并解决了STATIX求解器中的性能瓶颈,即名称分辨率算法的一部分。为此,我们引入了量身定制的程序中间查询分辨率语言,并提供了将声明性查询转换为此语言的专业人。通过在三个基准(Apache Commons CSV,IO和Lang3)上比较类型检查运行时间性能来评估此专业化程序,这表明我们的Specializer将查询分辨率提高到7.7倍,从而将总型检查运行时间降低了38-48%。
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%.