Proceedings Article10.1145/2737924.2738008
Lightweight, flexible object-oriented generics
Yizhou Zhang,Matthew C. Loring,Guido Salvaneschi,Barbara Liskov,Andrew C. Myers +4 more
- 03 Jun 2015
- Vol. 50, Iss: 6, pp 436-445
TL;DR: An expressive genericity mechanism is introduced that adds expressive power and strengthens static checking, while remaining lightweight and simple in common use cases and it is shown that common generic programming idioms, including current generic libraries, can be expressed more precisely and concisely.
read more
Abstract: The support for generic programming in modern object-oriented programming languages is awkward and lacks desirable expressive power We introduce an expressive genericity mechanism that adds expressive power and strengthens static checking, while remaining lightweight and simple in common use cases Like type classes and concepts, the mechanism allows existing types to model type constraints retroactively For expressive power, we expose models as named constructs that can be defined and selected explicitly to witness constraints; in common uses of genericity, however, types implicitly witness constraints without additional programmer effort Models are integrated into the object-oriented style, with features like model generics, model-dependent types, model enrichment, model multimethods, constraint entailment, model inheritance, and existential quantification further extending expressive power in an object-oriented setting We introduce the new genericity features and show that common generic programming idioms, including current generic libraries, can be expressed more precisely and concisely The static semantics of the mechanism and a proof of a key decidability property can be found in an associated technical report
read more
Chat with Paper
AI Agents for this Paper
Find similar papers on Google Scholar, PubMed and Arxiv
Write a critical review of this paper
Analyze citations of this paper to find unaddressed research gaps
Citations
•Posted Content
Towards an Accurate Mathematical Model of Generic Nominally-Typed OOP.
TL;DR: The concepts of `nominal intervals' and `full generication' are presented that are likely to help in building GNOOP as an accurate mathematical model of generic nominally-typed OOP.
10
Java generics are turing complete
TL;DR: It follows that subtype checking in Java is undecidable, which answers a question posed by the halting problem of Turing machines.
Accepting Blame: Expressive Checked Exceptions
Yizhou Zhang,Guido Salvaneschi,Quinn Beightol,Barbara Liskov,Andrew C. Myers +4 more
- 01 Apr 2016
TL;DR: This work introduces a new statically checked exception mechanism that addresses the problems with existing checked-exception mechanisms, and is expressive, syntactically light, and can be implemented efficiently.
Language Support for Generic Programming in Object-Oriented Languages: Peculiarities, Drawbacks, Ways of Improvement
Julia Belyakova
- 22 Sep 2016
TL;DR: This paper analyzes language constructs for GP in seven modern object-oriented languages and demonstrates that all of these languages follow the same approach to constraining type parameters, which has a number of inevitable problems.
5
References
•Book
The Java Language Specification
James Gosling,Bill Joy,Guy L. Steele +2 more
- 12 Sep 1996
TL;DR: The Java Language Specification, Second Edition is the definitive technical reference for the Java programming language and provides complete, accurate, and detailed coverage of the syntax and semantics of the Java language.
Featherweight Java: a minimal core calculus for Java and GJ
TL;DR: This work extends Featherweight Java with generic classes in the style of GJ and gives a detailed proof of type safety, which formalizes for the first time some of the key features ofGJ.
Abstraction mechanisms in CLU
TL;DR: This paper provides an introduction to the abstraction mechanisms in CLU and illustrates the utility of the three kinds of abstractions in program construction and shows how CLU programs may be written to use and implement abstractions.
536
Polyglot: an extensible compiler framework for Java
Nathaniel Nystrom,Michael R. Clarkson,Andrew C. Myers +2 more
- 07 Apr 2003
TL;DR: This paper focuses on the design choices in Polyglot that are important for making the framework usable and highly extensible.
MultiJava: modular open classes and symmetric multiple dispatch for Java
Curtis Clifton,Gary T. Leavens,Craig Chambers,Todd Millstein +3 more
- 01 Oct 2000
TL;DR: MultiJava is presented, a backward-compatible extension to Java supporting open classes and symmetric multiple dispatch, and adapt previous theoretical work to allow compilation units to be statically typechecked modularly and safely, ruling out any link-time or run-time type errors.