GraalVM: THE HOLY GRAIL OF VIRTUAL MACHINES
With such a pretentious name, Oracle presents what it considers to be the Holy Grail of Virtual Machines. But what are we talking about?
GraalVM is an ecosystem based on JDK 8 (Java Development Kit 8), which includes a Universal Virtual Machine with shared runtime.
As an ecosystem, GraalVM is a set of components, each with its own specific function:
A dynamic Just-In-Time (JIT) compiler which improves application efficiency and speed.
API Graal Polyglot
API combining programming languages into a shared runtime.
Useful API for the integration of Graal languages and the configuration of native images.
JVM Oracle HotSpot
Runtime environment for JVM-based languages.
This Oracle solution provides new perspectives on data processing contained within Oracle 12c and MySQL databases, in addition to the ability to run multilingual applications.
GraalVM is also able to make Java applications faster with a new compilation technology Just In Time, and, no small matter, to compile the Java bytecode into machine code.
It contains a function which allows you to create native images for existing applications based on JVM. The image generation process uses static analysis to find any code which can be reachable from the main Java method, and then perform the Ahead-Of-Time (AOT) compilation.
The resulting native binary contains the entire program in the form of a machine code for its immediate execution.
These features allow you to create a Native Java Function, as described in this tutorial. Or you can link to other native programs and include the compiler in an optional way.
THE 3 STRANDS OF APPLICATION IN INTERLOGICA
Currently, at Interlogica, we are testing the potential of this technology in three main strands, as Twitter is already using GraalVM in the production, with excellent results, to what they claim.
- The first strand concerns the optimization in the usage of resources, and performance increase by existing Java applications;
- The second is the creation of polyglot solutions, taking maximum advantage of the strengths of each language, especially in fields like data science and machine learning, where Python is covering the lion’s share, but C/C++ still continues to have the best performances.
- The chance to create machine codes for its immediate execution within embedded devices and IoT (Internet of Things), where resources are smaller and it is essential that the code stays minimal, for saving memory and runtime.
GraalVM still presents some errors of youth, completely understandable since version 1.0 is still going silver.
The potential of this product still remains high, and opens new scenarios in the development of a multitude of software solutions.
Originally published at www.interlogica.it on August 20, 2018.