6533b838fe1ef96bd12a45c2
RESEARCH PRODUCT
A systematic approach to deriving incremental type checkers
André PacakTamás SzabóSebastian Erdwegsubject
Operator overloadingRelation (database)Computer scienceProgramming languageInferencecomputer.software_genreDatalogSimple (abstract algebra)CompilerSafety Risk Reliability and QualityRule of inferencecomputerSoftwareLogic programmingcomputer.programming_languagedescription
Static typing can guide programmers if feedback is immediate. Therefore, all major IDEs incrementalize type checking in some way. However, prior approaches to incremental type checking are often specialized and hard to transfer to new type systems. In this paper, we propose a systematic approach for deriving incremental type checkers from textbook-style type system specifications. Our approach is based on compiling inference rules to Datalog, a carefully limited logic programming language for which incremental solvers exist. The key contribution of this paper is to discover an encoding of the infinite typing relation as a finite Datalog relation in a way that yields efficient incremental updates. We implemented the compiler as part of a type system DSL and show that it supports simple types, some local type inference, operator overloading, universal types, and iso-recursive types.
year | journal | country | edition | language |
---|---|---|---|---|
2020-11-13 | Proceedings of the ACM on Programming Languages |