A Co-contextual Type Checker for Featherweight Java

Conference Paper (2017)
Author(s)

Edlira Kuci (Technische Universität Darmstadt)

Sebastian Erdweg (TU Delft - Programming Languages)

Oliver Bračevac (Technische Universität Darmstadt)

Andi Bejleri (Technische Universität Darmstadt)

Mira Mezini (Technische Universität Darmstadt)

Research Group
Programming Languages
Copyright
© 2017 Edlira Kuci, S.T. Erdweg, Oliver Bračevac, Andi Bejleri, Mira Mezini
DOI related publication
https://doi.org/10.4230/LIPIcs.ECOOP.2017.18
More Info
expand_more
Publication Year
2017
Language
English
Copyright
© 2017 Edlira Kuci, S.T. Erdweg, Oliver Bračevac, Andi Bejleri, Mira Mezini
Research Group
Programming Languages
Pages (from-to)
1-26
ISBN (electronic)
978-3-95977-035-4
Reuse Rights

Other than for strictly personal use, it is not permitted to download, forward or distribute the text or part of it, without the consent of the author(s) and/or copyright holder(s), unless the work is under an open content license such as Creative Commons.

Abstract

This paper addresses compositional and incremental type checking for object-oriented programming languages. Recent work achieved incremental type checking for structurally typed functional languages through co-contextual typing rules, a constraint-based formulation that removes any context dependency for expression typings. However, that work does not cover key features of object-oriented languages: Subtype polymorphism, nominal typing, and implementation inheritance. Type checkers encode these features in the form of class tables, an additional form of typing context inhibiting incrementalization. In the present work, we demonstrate that an appropriate co-contextual notion to class tables exists, paving the way to efficient incremental type checkers for object-oriented languages. This yields a novel formulation of Igarashi et al.'s Featherweight Java (FJ) type system, where we replace class tables by the dual concept of class table requirements and class table operations by dual operations on class table requirements. We prove the equivalence of FJ's type system and our co-contextual formulation. Based on our formulation, we implemented an incremental FJ type checker and compared its performance against javac on a number of realistic example programs.