Nothing Special   »   [go: up one dir, main page]

skip to main content
10.1145/2517208.2517223acmconferencesArticle/Chapter ViewAbstractPublication PagesgpceConference Proceedingsconference-collections
research-article

Reified type parameters using Java annotations

Published: 27 October 2013 Publication History

Abstract

Java generics are compiled by-erasure: all clients reuse the same bytecode, with uses of the unknown type erased. C++ templates are compiled by-expansion: each type-instantiation of a template produces a different code definition. The two approaches offer trade-offs on multiple axes. We propose an extension of Java generics that allows by-expansion translation relative to selected type parameters only. This language design allows sophisticated users to get the best of both worlds at a fine granularity. Furthermore, our proposal is based on Java 8 Type Annotations (JSR 308) and the Checker Framework as an abstraction layer for controlling compilation without changes to the internals of a Java compiler.

References

[1]
D. Ancona, G. Lagorio, and E. Zucca. Jam-Designing a Java Extension with Mixins. ACM Transactions on Programming Languages and Systems (TOPLAS), 25(5):641--712, 2003.
[2]
R. Cardone, A. Brown, S. McDirmid, and C. Lin. Using Mixins to Build Flexible Widgets. In Proceedings of the 1st International Conference on Aspect-Oriented Software Development (AOSD), pages 76--85, New York, NY, USA, 2002.
[3]
W. Dietl, S. Dietzel, M. D. Ernst, K. Muşlu, and T. W. Schiller. Building and using Pluggable Type-Checkers. In Proceedings of the 33rd International Conference on Software Engineering, pages 681--690, 2011.
[4]
B. Eckel. Mixins: Something Else You Can't Do With Java Generics? http://www.artima.com/weblogs/viewpost.jsp?thread=132988, Oct. 2005.
[5]
N. Gafter. Super Type Tokens. http://gafter.blogspot.gr/2006/12/super-type-tokens.html, Dec. 2006.
[6]
T. Kamina and T. Tamai. McJava - A Design and Implementation of Java with Mixin-Types. In Proceedings of the Programming Languages and Systems: Second Asian Symposium, (APLAS), pages 4--6, Taipei, Taiwan, 2004.
[7]
M. Odersky. The Scala Language Specification, 2013.
[8]
M. Odersky and P. Wadler. Pizza into Java: translating theory into practice. In Proceedings of the 24th ACM SIGPLAN-SIGACT symposium on Principles of Programming languages (POPL), POPL '97, pages 146--159, New York, NY, USA, 1997. ACM.
[9]
M. M. Papi, M. Ali, T. L. Correa, Jr., J. H. Perkins, and M. D. Ernst. Practical Pluggable Types for Java. In Proceedings of the 2008 International Symposium on Software Testing and Analysis, ISSTA '08, pages 201--212, New York, NY, USA, 2008. ACM.
[10]
A. Sampson, W. Dietl, E. Fortuna, D. Gnanapragasam, L. Ceze, and D. Grossman. EnerJ: approximate data types for safe and general low-power computation. In Proceedings of the 32nd ACM SIGPLAN conference on Programming Language Design and Implementation (PLDI), pages 164--174, San Jose, California, USA, 2011.
[11]
J. Sasitorn and R. Cartwright. Efficient First-Class Generics on Stock Java Virtual Machines. In Proceedings of the 2006 ACM symposium on Applied computing, SAC '06, pages 1621--1628, New York, NY, USA, 2006. ACM.
[12]
Y. Smaragdakis and D. Batory. Implementing Layered Designs with Mixin Layers. In Proceedings of the 12th European Conference on Object-Oriented Programming (ECOOP), pages 550--570. Springer-Verlag LNCS 1445, 1998.
[13]
Y. Smaragdakis and D. Batory. Mixin-Based Programming in C++. In Generative and Component-Based Software Engineering Symposium (GCSE), pages 163--177. Springer-Verlag, LNCS 2177, 2000.
[14]
M. VanHilst and D. Notkin. Using C++ Templates to Implement Role-Based Designs. In JSSST International Symposium on Object Technologies for Advanced Software, pages 22--37. Springer Verlag, 1996.
[15]
M. VanHilst and D. Notkin. Using Role Components to Implement Collaboration-Based Designs. In Proceedings of the 1996 ACM SIGPLAN Conference on Object-Oriented Programming Systems, Languages and Applications (OOPSLA), pages 359--369, San Jose, California, USA, 1996.

Cited By

View all
  • (2014)Late data layoutACM SIGPLAN Notices10.1145/2714064.266019749:10(397-416)Online publication date: 15-Oct-2014
  • (2014)Late data layoutProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660197(397-416)Online publication date: 15-Oct-2014

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
GPCE '13: Proceedings of the 12th international conference on Generative programming: concepts & experiences
October 2013
198 pages
ISBN:9781450323734
DOI:10.1145/2517208
Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than the author(s) must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected].

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 27 October 2013

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. mixins
  2. pluggable types
  3. reification
  4. type annotation

Qualifiers

  • Research-article

Conference

GPCE'13
Sponsor:
GPCE'13: Generative Programming: Concepts and Experiences
October 27 - 28, 2013
Indiana, Indianapolis, USA

Acceptance Rates

GPCE '13 Paper Acceptance Rate 20 of 59 submissions, 34%;
Overall Acceptance Rate 56 of 180 submissions, 31%

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)5
  • Downloads (Last 6 weeks)1
Reflects downloads up to 16 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2014)Late data layoutACM SIGPLAN Notices10.1145/2714064.266019749:10(397-416)Online publication date: 15-Oct-2014
  • (2014)Late data layoutProceedings of the 2014 ACM International Conference on Object Oriented Programming Systems Languages & Applications10.1145/2660193.2660197(397-416)Online publication date: 15-Oct-2014

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media