A compiler architecture for domain-specific type error diagnosis

Alejandro Serrano, J. Hage

    Research output: Contribution to journalArticleAcademicpeer-review

    Abstract

    Domain-specific languages (DSLs) permeate current programming practices. An important kind of DSLs includes those developed and integrated within a host language, which we call embedded or internal DSLs. Unfortunately, embedded DSLs usually fall short on domainspecific error diagnosis, that is, they do not give control to DSL authors over how errors are reported to the programmer. As a consequence, implementation details of the DSL leak through in error messages, and programmers need to understand the internals of the DSL implementation to fix their code in a productive way. This paper addresses the challenge of building a compiler with integrated support for domain-specific error diagnosis. We assume that the type system is described using a constraint-based approach, and constraint solving is specified using rewrite rules. Domain information can then be injected at constraint gathering time via type rules, during constraint solving via specialized rules and axioms, and finally at blaming and reparation time via transformations. Furthermore, we define error contexts as a way to control the order in which solving and blaming proceeds. We engineer domain-specific error diagnosis in such a way that the compiler can also reuse the techniques for improving general error diagnosis.
    Original languageEnglish
    Pages (from-to)33-51
    JournalOpen Computer Science
    Volume9
    Issue number1
    DOIs
    Publication statusPublished - 14 Feb 2019

    Keywords

    • domain-specific languages
    • type error diagnosis
    • constraint-based type inference

    Fingerprint

    Dive into the research topics of 'A compiler architecture for domain-specific type error diagnosis'. Together they form a unique fingerprint.

    Cite this