Towards the Integration of Metaprogramming Services into Java

Ignacio Lagartos, Jose Manuel Redondo, Francisco Ortin

2017

Abstract

Dynamic languages are widely used in scenarios where runtime adaptability is a strong requirement. The metaprogramming features provided by these languages allow the dynamic adaptation of the structure of classes and objects, together with the evaluation of dynamically generated code. These features are used to build software capable of adapting to runtime changing environments. However, this flexibility is counteracted with the lack of static type checking provided by statically typed languages such as Java. Static type checking supports the earlier detection of type errors, involving a valuable tool in software development. In this position paper, we describe the steps we are following to add some runtime metaprogramming services to Java. We intend to provide the runtime flexibility of structural intercession and dynamic code evaluation provided by most dynamic languages, without losing the robustness of the compile-time type checking of Java. The metaprogramming services are provided as a library so, unlike other existing systems, any standard virtual machine and language compiler could be used.

References

  1. Andersson, J., Ritzau, T., 2000. Dynamic code update in JDrums. In Proceedings of the ICSE'00 Workshop on Software Engineering for Wearable and Pervasive Computing.
  2. Andersson, J., 2000. A deployment system for pervasive computing. In International Conference on Software Maintenance. Proceedings, pp. 262-270.
  3. Conde, P., Ortin, F., 2014. Jindy: a Java library to support invokedynamic. Computer Science and Information Systems 11(1), pp. 47-68.
  4. Gamma, E., Helm, R., Johnson, R., Vlissides, J., 1994. Design patterns: elements of reusable object-oriented software, Addison-Wesley Professional.
  5. Garcia, M., Ortin, F., Quiroga, J., 2016. Design and implementation of an efficient hybrid dynamic and static typing language. Software: Practice and Experience 46(2), pp. 199-226.
  6. Georges, A., Buytaert, D., Eeckhout, L., 2007. Statistically rigorous Java performance evaluation. In ObjectOriented Programming Systems and Applications, OOPSLA 7807, NY, USA, pp. 57-76.
  7. JavaParser, 2017. Process Java code programmatically. http://javaparser.org
  8. JRebel, 2017. Zero Turnaround JRebel, Reload code changes instantly. https://zeroturnaround.com/software/jrebel
  9. Kabanov, J., 2017. Reloading Java Classes 401: HotSwap and JRebel - Behind the Scenes. Zero Turnaround. https://zeroturnaround.com/rebellabs/reloading_java_c lasses_401_hotswap_jrebel
  10. Malabarba, S., Pandey, R., Gragg, J., Barr, E., Barnes, J.F., 2000. Runtime Support for Type-Safe Dynamic Java Classes. In Proceedings of the 14th European Conference on Object-Oriented Programming, London, UK, pp. 337-361.
  11. Meijer, E., Drayton, P., 2004. Dynamic Typing When Needed: The End of the Cold War Between Programming Languages. In Proceedings of the OOPSLA Workshop on Revival of Dynamic Languages.
  12. Oracle, 2011. JSR 292, supporting dynamically typed languages on the Java platform. https://www.jcp.org/en/jsr/detail?id=292
  13. Oracle, 2017. function package, Java Platform SE 8. https://docs.oracle.com/javase/8/docs/api/java/util/func tion/package-summary.html
  14. Oracle, 2017. instrument package, Java Platform SE 8. https://docs.oracle.com/javase/8/docs/api/java/lang/ins trument/package-summary.html
  15. Oracle, 2017. Java Virtual Machine Support for Non-Java Languages. http://docs.oracle.com/javase/7/docs/technotes/guides/ vm/multiple-language-support.html
  16. Orso, A., Rao, A., Harrold, M.J., 2002. A technique for dynamic updating of Java software. In Proceedings of the International Conference on Software Maintenance, pp. 649-658.
  17. Ortin, F., Cueva, J.M., 2002. Implementing a Real Computational-Environment Jump in order to Develop a Runtime-Adaptable Reflective Platform. ACM SIGPLAN Notices 37(8), pp. 35-44.
  18. Ortin, F., Cueva, J.M., 2003. Non-restrictive computational reflection. Computer Standards & Interfaces 25(3), pp. 241-251.
  19. Ortin, F., Diez, D., 2005. Designing an Adaptable Heterogeneous Abstract Machine by means of Reflection. Information and Software Technology 47(2), pp. 81-94.
  20. Ortin, F., Zapico, D., Cueva, J.M., 2007. Design Patterns for Teaching Type Checking in a Compiler Construction Course. IEEE Transactions on Education 50 (3), pp. 273-283.
  21. Ortin, F., Conde, P., Fernandez-Lanvin, D., Izquierdo, R., 2014. The Runtime Performance of invokedynamic: an Evaluation with a Java Library. IEEE Software 31 (4), pp. 82-90.
  22. Ortin, F., Labrador, M.A., Redondo, J.M., 2014. A hybrid class- and prototype-based object model to support language-neutral structural intercession. Information and Software Technology 56(2), pp. 199-219.
  23. Paulson, L.D., 2007. Developers Shift to Dynamic Programming Languages. IEEE Computer 40(2), pp. 12-15.
  24. Pina L., Hicks, M., 2013. Rubah: Efficient, Generalpurpose Dynamic Software Updating for Java. In the 5th Workshop on Hot Topics in Software Upgrades.
  25. Polyglot, 2017. A compiler front end framework for building Java language extensions. https://www.cs.cornell.edu/projects/polyglot
  26. Pukall, M., Kästner, C., Saake, G., 2008. Towards Unanticipated Runtime Adaptation of Java Applications. In 15th Asia-Pacific Software Engineering Conference, pp. 85-92.
  27. Quiroga, J., Ortin, F., Llewellyn-Jones, D., Garcia, M., 2016. Optimizing Runtime Performance of Hybrid Dynamically and Statically Typed Languages for the .Net Platform. Journal of Systems and Software 113, pp. 114-129.
  28. Redmond, B., Cahill, V., 2002. Supporting Unanticipated Dynamic Adaptation of Application Behaviour. In Proceedings of the 16th European Conference on Object-Oriented Programming, London, UK, pp. 205- 230.
  29. Redondo, J.M., Ortin, F., Cueva, J.M., 2008. Optimizing Reflective Primitives of Dynamic Languages. International Journal of Software Engineering and Knowledge Engineering 18(6), pp. 759-783.
  30. Redondo, J.M., Ortin, F., 2013. Efficient support of dynamic inheritance for class- and prototype-based languages. Journal of Systems and Software 86(2), pp. 278-301.
  31. Redondo, J.M., Ortin, F., 2015. A Comprehensive Evaluation of Widespread Python Implementations. IEEE Software 32(4), pp. 76-84.
  32. Subramanian, S. Hicks, M., McKinley, K.S., 2009. Dynamic Software Updates: A VM-centric Approach. In Proceedings of the 30th ACM SIGPLAN Conference on Programming Language Design and Implementation, NY, USA, pp. 1-12.
  33. Taha, W., Sheard, T., 2000. MetaML and multi-stage programming with explicit annotations. Theoretical Computer Science 248(1-2), pp. 211-242.
  34. Würthinger, T., Wimmer, C., Stadler, L., 2010. Dynamic Code Evolution for Java. In Proceedings of the 8th International Conference on the Principles and Practice of Programming in Java, NY, USA, pp. 10-19.
  35. Würthinger, T., Wimmer, C., Stadler, L., 2013. Unrestricted and safe dynamic code evolution for Java. Science in Computer Programming 78(5), pp. 481-498.
Download


Paper Citation


in Harvard Style

Lagartos I., Redondo J. and Ortin F. (2017). Towards the Integration of Metaprogramming Services into Java . In Proceedings of the 12th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE, ISBN 978-989-758-250-9, pages 277-284. DOI: 10.5220/0006355802770284


in Bibtex Style

@conference{enase17,
author={Ignacio Lagartos and Jose Manuel Redondo and Francisco Ortin},
title={Towards the Integration of Metaprogramming Services into Java},
booktitle={Proceedings of the 12th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,},
year={2017},
pages={277-284},
publisher={SciTePress},
organization={INSTICC},
doi={10.5220/0006355802770284},
isbn={978-989-758-250-9},
}


in EndNote Style

TY - CONF
JO - Proceedings of the 12th International Conference on Evaluation of Novel Approaches to Software Engineering - Volume 1: ENASE,
TI - Towards the Integration of Metaprogramming Services into Java
SN - 978-989-758-250-9
AU - Lagartos I.
AU - Redondo J.
AU - Ortin F.
PY - 2017
SP - 277
EP - 284
DO - 10.5220/0006355802770284