Towards Taming Java Wildcards and Extending Java with Interval Types

05/18/2018
by   Moez A. AbdelGawad, et al.
Rice University
0

Of the complex features of generic nominally-typed OO type systems, wildcard types and variance annotations are probably the hardest to fully grasp. As demonstrated when adding closures (a.k.a., lambdas) and when extending type inference in Java, wildcard types and variance annotations make the development and progress of OO programming languages, and of their type systems in particular, a challenging and delicate task. In this work we build on our concurrent work, in which we model Java subtyping using a partial graph product, to suggest how wildcard types in Java can be generalized, and simplified, to interval types. In particular, interval types correspond to endpoints of paths in the Java subtyping graph. In addition to being a simple and more familiar notion, that is easier to grasp than wildcard types, interval types are strictly more expressive than wildcard types. As such, we believe interval types, when developed and analyzed in full, will be a welcome addition to Java and other similar generic nominally-typed OO programming languages.

READ FULL TEXT

page 1

page 2

page 3

page 4

05/18/2018

Java Subtyping as an Infinite Self-Similar Partial Graph Product

Due to supporting variance annotations, such as wildcard types, the subt...
06/01/2017

Towards a Java Subtyping Operad

The subtyping relation in Java exhibits self-similarity. The self-simila...
06/01/2017

Towards a Java Subtyping Operad (extended version)

The subtyping relation in Java exhibits self-similarity. The self-simila...
05/18/2022

Global Type Inference for Featherweight Generic Java

Java's type system mostly relies on type checking augmented with local t...
05/28/2018

Fast Random Integer Generation in an Interval

In simulations, probabilistic algorithms and statistical tests, we often...
01/01/2022

Asymptotic Experiments with Data Structures: Bipartite Graph Matchings and Covers

We consider instances of bipartite graphs and a number of asymptotic per...
10/11/2021

User-driven Design and Evaluation of Liquid Types in Java

Bugs that are detected earlier during the development lifecycle are easi...

Please sign up or login with your details

Forgot password? Click here to reset