A Co-contextual Type Checker for Featherweight Java (incl. Proofs)

05/16/2017
by   Edlira Kuci, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
07/11/2023

Simple Reference Immutability for System F-sub

Reference immutability is a type based technique for taming mutation tha...
research
02/26/2019

Induction, Coinduction, and Fixed Points in PL Type Theory

Recently we presented a concise survey of the formulation of the inducti...
research
11/19/2021

Types for Tables: A Language Design Benchmark

Context: Tables are ubiquitous formats for data. Therefore, techniques f...
research
02/22/2020

Modeling the Invariance of Virtual Pointers in LLVM

Devirtualization is a compiler optimization that replaces indirect (virt...
research
10/07/2020

Type checking extracted methods

Many object-oriented dynamic languages allow programmers to extract meth...
research
05/04/2019

A Type System for First-Class Layers with Inheritance, Subtyping, and Swapping

Context-Oriented Programming (COP) is a programming paradigm to encourag...
research
09/15/2022

A case for DOT: Theoretical Foundations for Objects With Pattern Matching and GADT-style Reasoning

Many programming languages in the OO tradition now support pattern match...

Please sign up or login with your details

Forgot password? Click here to reset