Virtualization has proven its value to IT and to developers through technologies such as server virtualization and the venerable JVM. Operating system virtualization is about providing protection and isolation/security from other operating systems while maximizing system utilization. In the case of the JVM, the value is arguably more about providing an insulation layer that abstracts the application code from the underlying architectural idiosyncrasies. Wouldn’t it be nice if more languages had a virtualization layer?
Well, that may come to pass. An open-source project from the technologies of the Graal research project is the basis for GraalVM, a JVM that bundles Graal, Truffle and other select components. Graal is a new Just in Time (JIT) compiler that has been nurtured for the past several years primarily by Oracle Labs. Built in Java, GraalVM leverages the open-source project Graal to accelerate compilation performance and, in collaboration with a project called Truffle, a polyglot language compiler, provides optimized compilation capabilities for any programming language that supports the Truffle API.
GraalVM provides polyglot runtime functionality that brings the “write once, run anywhere” attribute of Java to any language that can be compiled by Graal, thereby serving as a unified infrastructure for compiling a plurality of programming languages across a multitude of devices as well as any SaaS application or data processing application. Moreover, GraalVM enables languages to interoperate with one another, thereby empowering developers to begin writing code in one language and subsequently leverage code written in another language. As such, the GraalVM has the potential to serve as a unified framework for compilation that facilitates enhanced portability and interoperability amongst programming languages.
Currently, Java compilation takes place by means of a two-step process whereby a Java compiler compiles the source code and generates bytecode; thereafter, the JVM converts the bytecode to machine code. The bytecode, which is saved as a .class file, is executed via a JIT compiler by a Java virtual machine (JVM) and thereby translated into machine code.
GraalVM promises to bring the speed of program execution specific to compiled languages such as C++ to interpreted languages by means of its support for the Truffle language-implementation framework. The Truffle API creates an Abstract Syntax Tree representation of source code that it subsequently converts into a Graal Intermediate Representation (IR). Graal enters the picture by performing advanced optimization on the Graal IR and transforming the result into machine code as a state of the art optimizing compiler.
Separate from its ability to accelerate compilation, GraalVM boasts the ability to allow programming languages to interoperate with one another by means of the Truffle Object Storage Model. Interoperability, here, means that GraalVM allows languages to access objects, classes and data structures from other languages. For example, developers can enable Java code to access code written in JavaScript, Ruby, R, or C/C++ and vice versa. GraalVM’s ability to facilitate interoperability between languages has the potential to give the programming world respite from the dizzying profusion of languages by providing a unified framework that empowers developers to integrate code from a plurality of languages into one unified code-base.
One of the unanswered questions for the larger GraalVM project, however, concerns its ability to attract developers to its open-source community to drive adoption and nurture a healthy ecosystem of code contribution. The project was initiated by, and is still led by Oracle Labs and will need robust and transparent governance to encourage contributions from the global community of developers as well as the support of the enterprise and startup community, alike.
Of particular concern is the lack of a diverse community supporting GraalVM. Vendors that should have an interest in this project but apparently do not – Microsoft, IBM, Red Hat, and Intel all come to mind – seem to indicate that either the project has been flying too low to show up on their radar, or that there is some inherent resistance to supporting the project for either technology reasons or for competitive reasons. That said, there were substantial contributions from Red Hat (ARM back end), Intel (optimizations for the Intel platform), and Twitter (bug fixes). Those were more along the lines of one-time contributions rather than an ongoing stream of commits. In the case of GraalVM, deep and sustained support from the developer community will be critical to its success, particularly if GraalVM aspires to integrate a growing roster of languages into its infrastructure.
Overall, GraalVM promises to enhance the developer experience by way of its polyglot capability to accelerate, improve, streamline and simplify application runtime and performance. The key to its success, however, will hinge on Oracle’s ability to court developer mindshare and create collaborative processes that support its evolution.