Towards a Java Library to Support Runtime Metaprogramming

Statically typed languages such as Java offer two key advantages: robustness increase due to compile time error detection, and better runtime performance caused by the reduction of runtime type checking. However, dynamic languages are sometimes preferred in scenarios where runtime adaptability is a strong requirement, such as building software capable of adapting to runtime changing environments. The metaprogramming features of dynamic languages allow the runtime adaptation of class and object structures, modifying inheritance relationships, and the evaluation of dynamically generated code. In this position paper, we describe the steps we are following to add to Java some of the metaprogramming services provided by most dynamic languages. The objective is to provide the runtime flexibility of structural intercession, dynamic inheritance and dynamic code evaluation, without losing the robustness of compile-time type checking. The metaprogramming services are provided as a library so, unlike other existing systems, any standard virtual machine and language implementation could be used.

[1]  Walid Taha,et al.  MetaML and multi-stage programming with explicit annotations , 2000, Theor. Comput. Sci..

[2]  Manuel Serrano,et al.  Wide Classes , 1999, ECOOP.

[3]  Lieven Eeckhout,et al.  Statistically rigorous java performance evaluation , 2007, OOPSLA.

[4]  Michael Hicks,et al.  Rubah: Efficient, General-purpose Dynamic Software Updating for Java , 2013, HotSWUp.

[5]  David Llewellyn-Jones,et al.  Optimizing runtime performance of hybrid dynamically and statically typed languages for the .Net platform , 2016, J. Syst. Softw..

[6]  Sophia Drossopoulou,et al.  Fickle : Dynamic Object Re-classification , 2001, ECOOP.

[7]  Gunter Saake,et al.  Towards Unanticipated Runtime Adaptation of Java Applications , 2008, 2008 15th Asia-Pacific Software Engineering Conference.

[8]  Juan Manuel Cueva Lovelle,et al.  Implementing a real computational-environment jump in order to develop a runtime-adaptable reflective platform , 2002, SIGP.

[9]  Frederic P. Miller,et al.  Common Lisp: Lisp (programming language), Programming language, American National Standards Institute, Specification (technical standard), Free and open source software, Programming paradigm , 2010 .

[10]  Linda G. DeMichiel,et al.  The Common Lisp Object System: An Overview , 1987, ECOOP.

[11]  Juan Manuel Cueva Lovelle,et al.  Optimizing Reflective Primitives of Dynamic Languages , 2008, Int. J. Softw. Eng. Knowl. Eng..

[12]  Ralph Johnson,et al.  design patterns elements of reusable object oriented software , 2019 .

[13]  Miguel A. Labrador,et al.  A hybrid class- and prototype-based object model to support language-neutral structural intercession , 2014, Inf. Softw. Technol..

[14]  Linda Dailey Paulson Developers shift to dynamic programming languages , 2007, Computer.

[15]  Vinny Cahill,et al.  Supporting Unanticipated Dynamic Adaptation of Application Behaviour , 2002, ECOOP.

[16]  David Robson,et al.  Smalltalk-80: The Language and Its Implementation , 1983 .

[17]  Francisco Ortin,et al.  JINDY: A java library to support invokedynamic , 2014, Comput. Sci. Inf. Syst..

[18]  Thomas Würthinger Dynamic code evolution for Java , 2010, PPPJ.

[19]  Francisco Ortin,et al.  A Comprehensive Evaluation of Common Python Implementations , 2015, IEEE Software.

[20]  Alessandro Orso,et al.  A technique for dynamic updating of Java software , 2002, International Conference on Software Maintenance, 2002. Proceedings..

[21]  Juan Manuel Cueva Lovelle,et al.  Non-restrictive computational reflection , 2003, Comput. Stand. Interfaces.

[22]  Christian Wimmer,et al.  Unrestricted and safe dynamic code evolution for Java , 2013, Sci. Comput. Program..

[23]  Francisco Ortin,et al.  Efficient support of dynamic inheritance for class- and prototype-based languages , 2013, J. Syst. Softw..

[24]  Earl T. Barr,et al.  Runtime Support for Type-Safe Dynamic Java Classes , 2000, ECOOP.

[25]  Francisco Ortin,et al.  Towards the Integration of Metaprogramming Services into Java , 2017, ENASE.

[26]  Francisco Ortin,et al.  Designing an adaptable heterogeneous abstract machine by means of reflection , 2005, Inf. Softw. Technol..

[27]  Kathryn S. McKinley,et al.  Dynamic software updates: a VM-centric approach , 2009, PLDI '09.

[28]  François Pottier,et al.  A constraint-based approach to guarded algebraic data types , 2007, TOPL.

[29]  Francisco Ortin,et al.  Design and implementation of an efficient hybrid dynamic and static typing language , 2016, Softw. Pract. Exp..

[30]  Juan Manuel Cueva Lovelle,et al.  Design Patterns for Teaching Type Checking in a Compiler Construction Course , 2007, IEEE Transactions on Education.

[31]  Davide Ancona,et al.  A provenly correct translation of Fickle into Java , 2007, TOPL.

[32]  Raúl Izquierdo,et al.  The Runtime Performance of invokedynamic: An Evaluation with a Java Library , 2014, IEEE Software.

[33]  Jesper Andersson A deployment system for pervasive computing , 2000, Proceedings 2000 International Conference on Software Maintenance.