Abstract
We present a way to restrict recursive inheritance without sacrificing the benefits of F-bounded polymorphism. In particular, we distinguish two new concepts, materials and shapes, and demonstrate through a survey of 13.5 million lines of open-source generic-Java code that these two concepts never actually overlap in practice. With this Material-Shape Separation, we prove that even naïve type-checking algorithms are sound and complete, some of which address problems that were unsolvable even under the existing proposals for restricting inheritance. We illustrate how the simplicity of our design reflects the design intuitions employed by programmers and potentially enables new features coming into demand for upcoming programming languages.
- Franz Baader and Wayne Snyder. Unification theory. Handbook of Automated Reasoning, 1:445--532, 2001.Google Scholar
Cross Ref
- Kim B Bruce, Martin Odersky, and Philip Wadler. A statically safe alternative to virtual types. In ECOOP, 1998. Google Scholar
Digital Library
- The Ceylon language specification, version 1.0. ceylon-lang.org/documentation/1.0/spec/, November 2013.Google Scholar
- Peter S. Canning, William R. Cook, Walter L. Hill, Walter G. Olthoff, and John C. Mitchell. F-bounded polymorphism for object-oriented programming. In FPCA, 1989. Google Scholar
Digital Library
- Erik Ernst. Family polymorphism. In ECOOP, 2001. Google Scholar
Digital Library
- James Gosling, Bill Joy, Guy Steele, and Gilad Bracha. The Java#8482; Language Specification. Addison-Wesley Professional, 2005. Google Scholar
Digital Library
- Benjamin Greenman, Fabian Muehlboeck, and Ross Tate. Getting F-bounded polymorphism into shape. Technical report, Cornell University, March 2014.Google Scholar
- Anders Hejlsberg, Scott Wiltamuth, and Peter Golde. C# Language Specification. Addison-Wesley Longman Publishing Co., Inc., 2003. Google Scholar
Digital Library
- Shan Shan Huang, David Zook, and Yannis Smaragdakis. cJ: Enhancing Java with safe type conditions. In AOSD, 2007.Google Scholar
Digital Library
- Atsushi Igarashi and Benjamin C. Pierce. Foundations for virtual types. In ECOOP, 1999. Google Scholar
Digital Library
- Andrew J. Kennedy and Benjamin C. Pierce. On decidability of nominal subtyping with variance. In FOOL, 2007.Google Scholar
- Bent Bruun Kristensen, Ole Lehrmann Madsen, Birger Møller-Pedersen, and Kristen Nygaard. Abstraction mechanisms in the BETA programming language. In POPL, 1983. Google Scholar
Digital Library
- Ole Lehrmann Madsen and Birger Møller-Pedersen. Virtual classes - a powerful mechanism in object-oriented programming. In OOPSLA, 1989. Google Scholar
Digital Library
- Robin Milner, Lockwood Morris, and Malcolm Newey. A Logic for Computable Functions with Reflexive and Polymorphic Types. Department of Computer Science, University of Edinburgh, 1975.Google Scholar
- Martin Odersky. The Scala language specification, version 2.9, March 2014.Google Scholar
- Martin Odersky and Matthias Zenger. Scalable component abstractions. In OOPSLA, 2005. Google Scholar
Digital Library
- Benjamin C. Pierce and Martin Steffen. Higher-order subtyping. Theoretical Computer Science, 176(1--2):235--282, 1997. Google Scholar
Digital Library
- Daniel Smith and Robert Cartwright. Java type inference is broken: Can we fix it? In OOPSLA, 2008. Google Scholar
Digital Library
- Ross Tate. Mixed-site variance. In FOOL, 2013.Google Scholar
- Ross Tate, Alan Leung, and Sorin Lerner. Taming wildcards in Java's type system. In PLDI, 2011. Google Scholar
Digital Library
- Ewan Tempero, Craig Anslow, Jens Dietrich, Ted Han, Jing Li, Markus Lumpe, Hayden Melton, and James Noble. Qualitas Corpus: A curated collection of Java code for empirical studies. In APSEC, 2010. Google Scholar
Digital Library
- Ricardo Terra, Luis Fernando Miranda, Marco Tulio Valente, and Roberto S. Bigonha. Qualitas.class Corpus: A compiled version of the Qualitas Corpus. Software Engineering Notes, 38(5):1--4, 2013. Google Scholar
Digital Library
- Kresten Krab Thorup. Genericity in Java with virtual types. In ECOOP, 1997.Google Scholar
Cross Ref
- Kresten Krab Thorup and Mads Torgersen. Unifying genericity - combining the benefits of virtual types and parameterized classes. In ECOOP, 1999. Google Scholar
Digital Library
- Mads Torgersen. Virtual types are statically safe. In FOOL, 1998.Google Scholar
- Mads Torgersen, Christian Plesner Hansen, Erik Ernst, Peter von der Ahé, Gilad Bracha, and Neal M. Gafter. Adding wildcards to the Java programming language. In SAC, 2004. Google Scholar
Digital Library
- Mirko Viroli. On the recursive generation of parametric types. Technical Report DEIS-LIA-00-002, University of Bologna, Italy, September 2000.Google Scholar
- Philip Wadler and Stephen Blott. How to make ad-hoc polymorphism less ad-hoc. In POPL, 1989. Google Scholar
Digital Library
- Stefan Wehr, Ralf Lämmel, and Peter Thiemann. JavaGI: Generalized interfaces for Java. In ECOOP, 2007. Google Scholar
Digital Library
Index Terms
Getting F-bounded polymorphism into shape
Recommendations
Getting F-bounded polymorphism into shape
PLDI '14: Proceedings of the 35th ACM SIGPLAN Conference on Programming Language Design and ImplementationWe present a way to restrict recursive inheritance without sacrificing the benefits of F-bounded polymorphism. In particular, we distinguish two new concepts, materials and shapes, and demonstrate through a survey of 13.5 million lines of open-source ...
System F with coercion constraints
CSL-LICS '14: Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)We present a second-order λ-calculus with coercion constraints that generalizes a previous extension of System F with parametric coercion abstractions by allowing multiple but simultaneous type and coercion abstractions, as well as recursive coercions ...
Taming wildcards in Java's type system
PLDI '11Wildcards have become an important part of Java's type system since their introduction 7 years ago. Yet there are still many open problems with Java's wildcards. For example, there are no known sound and complete algorithms for subtyping (and ...







Comments