A framework for improving error messages in dependently-typed languages

Autor: Eremondi Joseph, Swierstra Wouter, Hage Jurriaan
Jazyk: angličtina
Rok vydání: 2019
Předmět:
Zdroj: Open Computer Science, Vol 9, Iss 1, Pp 1-32 (2019)
Druh dokumentu: article
ISSN: 2299-1093
DOI: 10.1515/comp-2019-0001
Popis: Dependently-typed programming languages provide a powerful tool for establishing code correctness. However, it can be hard for newcomers to learn how to employ the advanced type system of such languages effectively. For simply-typed languages, several techniques have been devised to generate helpful error messages and suggestions for the programmer. We adapt these techniques to dependently-typed languages, to facilitate their more widespread adoption. In particular, we modify a higher-order unification algorithm that is used to resolve and type-check implicit arguments. We augment this algorithm with replay graphs, allowing for a global heuristic analysis of a unification problem-set, error-tolerant typing, which allows type-checking to continue after errors are found, and counter-factual unification, which makes error messages less affected by the order in which types are checked. A formalization of our algorithm is presented with an outline of its correctness. We implement replay graphs, and compare the generated error messages to those from existing languages, highlighting the improvements we achieved.
Databáze: Directory of Open Access Journals