Affiliation:
1. Eötvös Loránd University
Abstract
Type parametrization is an essential construct in modern programming languages. On one hand, Java offers generics, on the other hand, C++ offers templates for highly reusable code. The mechanism between these constructs differs and affects usage and runtime performance, as well. Java uses type erasure, C++ deals with instantiations.In this paper, we argue for an approach in Java which is similar to C++ template construct. We evaluate the runtime performance of instantiated code and we present our tool which is able to use Java generics as templates. This tool generates Java source code. We present how this approach improves the usage of Java generics.
Subject
Computer Vision and Pattern Recognition,Software,Computer Science (miscellaneous),Electrical and Electronic Engineering,Information Systems and Management,Management Science and Operations Research,Theoretical Computer Science
Reference15 articles.
1. Project Lombok. https://projectlombok.org/
2. Arnold, Ken, Gosling, James, and Holmes, David. Java(TM) Programming Language, The (4th Edition). Addison-Wesley Professional, 2005.
3. C/C++ Preprocessing with modern data storage devices
4. A static C++ object-oriented programming (SCOOP) paradigm mixing benefits of traditional OOP and generic programming;Burrus,2003
5. Performance analysis of generics in scientific computing