A short introduction to GraalVM

GraalVM is an ecosystem and shared runtime offering performance advantages not only to JVM-based languages such as Java, Scala, Groovy, and Kotlin, but also to other programming languages such as JavaScript, Ruby, Python, and R. Additionally, it enables the execution of native code on the JVM via an LLVM front-end. GraalVM 1.0 is based on JDK 8.

GraalVM system diagram

The preceding diagram illustrates the architecture of GraalVM as an open ecosystem.

The virtualization layer represents programming languages, provided by GraalVM. The execution of guest programming languages, namely JavaScript, Ruby, R, Python and LLVM bitcode, in the same runtime as the host JVM-based application is now down-to-earth. The host language and guest languages can directly interoperate with each other and pass data back and forth in the same memory space.

The bottom part demonstrates the applicability range. GraalVM can either run standalone, be embedded as part of OpenJDK or node.js platforms, or even embed inside databases such as MySQL or Oracle RDBMS.

The GraalVM 1.0 release contains language interpreters for:

  • JVM-based languages like Java, Scala, Groovy, or Kotlin
  • JavaScript (including node.js)
  • languages compiling to LLVM bitcode like C, C++, or Rust
  • experimental versions of Ruby, R, and Python

GraalVM includes the following components:

  • Graal: A dynamic just-in-time (JIT) compiler that improves efficiency and speed of applications through unique approaches to code analysis and optimization.
  • Graal Polyglot APIs: APIs for combining programming languages in a shared runtime. These APIs allow you to match programming languages to your needs and gives you better performance using fewer resources.
  • Graal SDK: A set of APIs useful for embedding Graal languages and configuring native images.
  • Oracle HotSpot Java Virtual Machine (JVM): A runtime environment for JVM-based languages and supported guest programming languages.

GraalVM Features

GraalVM lets you:

GraalVM Documentation

Whether you are here to try running an application with GraalVM for the first time or ready to start coding with the Graal Polyglot APIs, check out the Graal documentation to help you on your way.

Alternatively you can have a look at the reference documentation in JavaDoc:

  • The Polyglot Package allows you to configure and run polyglot applications.
  • The Proxy Package allows you to mimic Graal language objects using proxies.
  • The IO Package allows you to customize the file system access of languages.

If you can’t find the answer you need or have a troubleshooting query, get in touch with us.