Abstract

Type parametrization is an essential construct in modern programming languages, Java offers generics, 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 a new approach in Java which is similar to C++ template construct. The proposed method contains a template syntax and a developed tool which can instantiate Java templates and generates Java source code. The templates have advantages related to special template parameters that are not supported by generics. On the other hand, the instantiations have to be processed at compilation time, but the runtime performance of the code is improved. We measure how the Java templates speed-up the execution.

Full Text
Paper version not known

Talk to us

Join us for a 30 min session where you can share your feedback and ask us any queries you have

Schedule a call

Disclaimer: All third-party content on this website/platform is and will remain the property of their respective owners and is provided on "as is" basis without any warranties, express or implied. Use of third-party content does not indicate any affiliation, sponsorship with or endorsement by them. Any references to third-party content is to identify the corresponding services and shall be considered fair use under The CopyrightLaw.