Journal article

Title:
A case for DOT: theoretical foundations for objects with pattern matching and GADT-style reasoning
Authors:
A. Boruch-Gruszecki, R. Waśko, Y. Xu, L. Parreaux
Publication:
Mechanized proof of «A case for DOT: Theoretical Foundations for Objects With Pattern Matching and GADT-style Reasoning» 6 (OOPSLA2)
DOI:
Year:
2022
Link:

Abstract:
Many programming languages in the OO tradition now support pattern matching in some form. Historical examples include Scala and Ceylon, with the more recent additions of Java, Kotlin, TypeScript, and Flow. But pattern matching on generic class hierarchies currently results in puzzling type errors in most of these languages. Yet this combination of features occurs naturally in many scenarios, such as when manipulating typed ASTs. To support it properly, compilers needs to implement a form of subtyping reconstruction: the ability to reconstruct subtyping information uncovered at runtime during pattern matching. We introduce cDOT, a new calculus in the family of Dependent Object Types (DOT) intended to serve as a formal foundation for subtyping reconstruction. Being descended from pDOT, itself a formal foundation for Scala, cDOT can be used to encode advanced object-oriented features such as generic inheritance, type constructor variance, F-bounded polymorphism, and first-class recursive modules. We demonstrate that subtyping reconstruction subsumes GADTs by encoding λ2,Gµ, a classical constraint-based GADT calculus, into cDOT.

BibTeX:
@article{boruchgruszecki_case_2022,
    title = {{A case for DOT: theoretical foundations for objects with pattern matching and GADT-style reasoning}},
    author = {Boruch-Gruszecki, Aleksander and Waśko, Radosław and Xu, Yichen and Parreaux, Lionel},
    year = {2022},
    journal = {{Mechanized proof of « A case for DOT: Theoretical Foundations for Objects With Pattern Matching and GADT-style Reasoning»}},
    number = {OOPSLA2},
    doi = {10.1145/3563342},
    pages = {179:1526--179:1555},
    url = {https://dl.acm.org/doi/10.1145/3563342},
    volume = {6},
    shorttitle = {A case for DOT},
}