Journal "Software Engineering"
a journal on theoretical and applied science and technology
ISSN 2220-3397

Issue N4 2024 year

DOI: 10.17587/prin.15.190-198
Analysis of Interaction Mechanisms between Java and JavaScript Programming Languages: from LiveConnect to Graal.js
R. V. Lukichev, Masters Degree Student, ruslanlukichev@gmail.com, I. B. Gosudarev, Associate Professor, goss@itmo.ru, Faculty of Software Engineering and Computer Systems, ITMO University, Saint Petersburg, 197101, Russian Federation
Corresponding author: Ruslan V. Lukichev, Masters Degree Student, ITMO University, Saint Petersburg, 197101, Russian Federation, E-mail: ruslanlukichev@gmail.com
Received on November 02, 2023
Accepted on February 01, 2024

The article is devoted to the study of the mechanisms of interaction between the popular programming languages Java and JavaScript using a retrospective approach. The author consistently examines the development of tools of this kind, starting from LiveConnect technology and Java applets of the mid-1990s and ending with the interpreters of the last decade. Particular attention is paid to comparing the performance of the currently relevant tools Nashorn and Graal.js. The latter is an implementation of the JavaScript language based on the Truffle framework and Context API, which is a Polyglot context for executing all supported guest languages with the Graal JIT compiler, ensuring their optimal performance. The author gives a definition to the term "warm-up", which is recommended by the GraalVM developers to achieve the highest performance. This is a kind of pre-compilation mode, the process of repeated preliminary execution of JavaScript code by the interpreter before its actual usage in order to obtain information about the most frequently utilized fragments of the program, its functions, types and data structures, alongside with their subsequent caching and optimization. The results of testing based on a project from Oracle and the authors application made it possible to verify the results declared by the GraalVM developers and can be used to optimize and improve the performance of multilingual projects using a unified technology stack, as well as when migrating the server code base from Java to JavaScript.

Keywords: programming languages, Java, JavaScript, interpreter, Java virtual machine, Java applet, Nashorn, Graal.js, testing, interoperability
pp. 190–198
For citation:
Lukichev R. V., Gosudarev I. B. Analysis of Interaction Mechanisms between Java and JavaScript Programming Languages: from LiveConnect to Graal.js, Programmnaya Ingeneria, 2024, vol. 15, no. 4, рр. 190-198. DOI: 10.17587/prin.15.190-198 (in Russian).
References:
    • Severance C. Designing a Language in 10 Days, Computer, 2012, vol. 45, р. 7-8. DOI: 10.1109/MC.2012.57.
    • Wirfs-Brock A., Eich B. JavaScript: The first 20 years, Proceedings of the ACM on Programming Languages, 2020, vol. 4, no. 77, pp. 1-189. DOI: 10.1145/3386327.
    • Sedykh A., Ryazanov Yu. D. Scripting language «Link» for programming scripts of executable event systems, Nauchnyy rezultat. Informatsionnyye tekhnologii, 2017, vol. 2, no. 2. pp. 21-33. DOI: 10.18413/2518-1092-2017-2-2-21-33 (in Russian).
    • Grimmer M., Schatz R., Seaton C. et al. Cross-Language Interoperability in a Multi-Language Runtime, ACM Transactions on Programming Languages and Systems, 2018, vol. 40, no. 2, article 8. DOI: 10.1145/3201898.
    • Netscape sharpens Javagator plans, CNET. Dec. 30, 1997, available at: https://www.cnet.com/tech/tech-industry/netscape-sharpens-javagator-plans/ (date of access 17.09.2023).
    • Glave J. Will Javagator Be Reborn as Jazilla? WIRED. Apr. 3, 1998, available at: https://www.wired.com/1998/04/will-javagator-be-reborn-as-jazilla/ (date of access 17.09.2023).
    • Flanagan D. JavaScript. Detailed guide, St. Petersburg: SymbolPlus, 2008, 992 p. (in Russian).
    • Byrne M. The rise and fall of the Java-applet: creative coding's awkward little square, Vice, Feb. 2, 2016, available at: https://www.vice.com/en/article/8q8n3k/a-brief-history-of-the-java-applet (date of access 24.09.2023).
    • Humble C. Nashorn Proposed as Replacement JavaScript Engine for OpenJDK, InfoQ, Nov. 29, 2012, available at: https://www.infoq.com/news/2012/11/Nashorn-proposal/ (date of access 24.09.2023).
    • Krill P. Oracle: Switch now from Nashorn JavaScript engine to GraalVM, InfoWorld, Jul. 20, 2018, available at: https://www. infoworld.com/article/3291322/oracle-switch-now-from-nashorn-javascript-engine-to-graalvm.html (date of access 30.09.2023).
    • Brown S. GraalVM: the holy graal of polyglot JVM? Trans-posit, Jan. 2, 2019, available at: https://www.transposit.com/devops-blog/devops/2019.01.02-graalvm-holy/ (date of access 30.09.2023).
    • Sipek M., Mihaljevic B., Radovan A. Exploring Aspects of Polyglot High-Performance Virtual Machine GraalVM, 42nd International Convention on Information and Communication Technology, Electronics and Microelectronics (MIPRO), Opatija, Croatia, 2019, pp. 1671-1676. DOI: 10.48550/arXiv2112.14716.