GraalVM is an alternative to the JVM developed by Oracle, i.e. Java Virtual Machine. GraalVM should contribute with its functionality to the more powerful compilation of Java applications. As a polyglot VM, GraalVM can also integrate external libraries.
The designation GraalVM is an abbreviation for “General Recursive Applicative and Algorithmic Language Virtual Machine”. The GraalVM project comes from Oracle. The GraalVM is intended to give developers a way to compile Java applications more efficiently . The GraalVM combines all functions of the GraalVM. The development of the GraalVM began in 2013.
At the time, Oracle Labs was researching a virtual machine for Java, which itself was written in Java. The Java Virtual Machine itself, on the other hand, is in most cases written in the programming languages C or C ++. The aim of the GraalVM project is to replace the C and C ++ components in the current JVM platforms. This should make it possible to use the advantages of the Java Virtual Machine in other languages.
According to SCIENCEDICT, the GraalVM executes Java-based programs faster and more efficiently than would be possible with the classic JVM. The code can either be interpreted directly or translated in a compiler . This can be done in a number of ways. Thanks to the polyglot orientation of GraalVM, other programs can also be integrated.
Since the virtual machine cannot only handle Java code, Oracle Labs chose the name GraalVM and not GraalJVM. Programs that were written in other programming languages such as Scala or C benefit from this in particular.
Basics and functionality of the GraalVM
The compiler plays an important role in the functionality of the GraalVM. This is based on the JVM Compiler Interface (JVMCI). He is able to provide Java applications with efficient machine code and thus accelerate them. The compiler itself is written in Java so that developers can concentrate fully on this programming language and do not have to deal with C ++ as well.
The GraalVM compiler still has internal optimization routines. These enable the compiler to continuously improve its own work. The use of the compiler requires the GraalVM to be downloaded. The focus of this compiler is on performance. The applications or apps should be provided as powerfully as possible.
This can result in the compilation process taking more time and the app consuming more resources. In particular, this includes more memory. The GraalVM native image also provides an executable file via the compiler. Applications can also be implemented with GraalVM in such a way that they can be converted from code to running program in the shortest possible time.
The GraalVM and its versions
With regard to GraalVM, a basic distinction must be made between the free Community Edition and the commercial Enterprise Edition. The Graal source code is available on GitHub . Graals binary files are available for Linux / X86, Linux / ARM, Windows and macOS. GraalVM still contains numerous technologies that have been adopted from other projects. These include OpenJDK and Node.js.
As these are not maintained or updated by the GraalVM community, the responsibility for these technologies lies with their respective developers. According to its developers, the commercial enterprise edition Graals offers improved performance and scalability as well as increased security. Furthermore, Oracle offers support around the clock for the Enterprise Edition. The Enterprise Edition can be tested free of charge for a limited period of time.
The developers recommend the Enterprise Edition instead of the free community version due to the stronger compiler and higher security for operational and professional use. In principle, however, the Community Edition can also be used in professional applications. It should be noted that the community version does not offer full Oracle support.
Substrate VM as part of the GraalVM project
An important part of the Graal project is the SubstrateVM, which is used to provide users with a command line tool. The lean virtual machine, written in Java, takes over the tasks of the JVM in its final binary. These include thread management and garbage collection.
The substrate VM is used instead of the JVM. It does not offer the maximum possible performance of an app, but it does ensure that the app starts up quickly. This is particularly interesting for serverless applications. Programs with a shorter duration also benefit from it. Thanks to the Substrate VM, programs require fewer resources and can start faster.
Further options and possibilities of the GraalVM
In addition to the Java applications and their performance-optimized compilation, GraalVM has other properties and options. Currently, Node.js, Ruby , R and Python can also be executed via GraalVM. This means that programs written in these languages also benefit from the same options in GraalVM compilation as Java applications.
Due to this general support, applications can also be operated that have access from Java to modules that have been designed in other languages. The integration of libraries from other languages into the Java applications is possible without any problems due to the polyglot character of GraalVM.