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, 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 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 the OpenJDK or Node.js platforms, or even execute inside Oracle Database.

GraalVM Distributions

GraalVM 20.0.0 is distributed as the Community Edition and the Enterprise Edition bundled for Linux, macOS and Windows platforms on x86 64-bit systems. GraalVM builds are based on JDK 8 and on JDK 11. GraalVM bundles based on JDK 11 become available as of version 19.3.0.

The following distributions are available for download:

  • graalvm-ee-java8-linux-amd64-20.0.0
  • graalvm-ce-java8-linux-amd64-20.0.0
  • graalvm-ee-java8-darwin-amd64-20.0.0
  • graalvm-ce-java8-darwin-amd64-20.0.0
  • graalvm-ee-java11-linux-amd64-20.0.0
  • graalvm-ce-java11-linux-amd64-20.0.0
  • graalvm-ee-java11-darwin-amd64-20.0.0
  • graalvm-ce-java11-darwin-amd64-20.0.0
  • graalvm-ce-java11-linux-aarch64-20.0.0

GraalVM support on Windows platforms is currently under development, but the below pre-built binaries are provided for evaluation and testing use:

  • graalvm-ee-java8-windows-amd64-20.0.0
  • graalvm-ce-java8-windows-amd64-20.0.0
  • graalvm-ee-java11-windows-amd64-20.0.0
  • graalvm-ce-java11-windows-amd64-20.0.0

Note: The support for Windows is experimental.

Distribution Components List

GraalVM consists of core and optional components, and is distributed as an archive. That archive enables using GraalVM as a runtime platform for high-performance embeddable polyglot applications and includes the following:

  • Runtimes
    • Java HotSpot VM runtime with the GraalVM compiler enabled as the top tier JIT compiler for JVM-based languages and supported guest programming languages.
    • Node.js runtime with the GraalVM JavaScript interpreter enabled as the JavaScript engine.
  • Libraries (jar files)
    • GraalVM Compiler – a dynamic just-in-time (JIT) compiler that improves efficiency and speed of applications through unique approaches to code analysis and optimization.
    • JavaScript interpreter – an ECMAScript compliant JavaScript engine.
    • LLVM bitcode interpreter – an implementation of the lli tool to directly execute programs from LLVM bitcode.
    • GraalVM Polyglot API – the 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.
  • Utilities
    • JavaScript REPL with the GraalVM JavaScript interpreter
    • LLVM bitcode interpreter command line utility
    • GraalVM Updater utility to install and manage additional components

GraalVM base installation can be extended with the optional components:

  • GraalVM Native Image functionality which allows scripted applications to be compiled ahead-of-time into a native machine-code binary. Note: GraalVM Native Image is available as an Early Adopter technology.
  • LLVM toolchain – a set of tools and APIs for compiling native programs to bitcode that can be executed with the GraalVM LLVM runtime.
  • Python interpreter – a Python 3.7 compliant implementation.
  • Ruby interpreter – the Ruby engine based on the standard implementation of Ruby, MRI, version 2.6.5.
  • R interpreter – a GNU R 3.6.1 compatible implementation of the R programming language.

Note: The support for Ruby, R and Python languages is experimental.

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 GraalVM Polyglot APIs, check out our documentation to help you on your way.

Alternatively you can have a look at the reference documentation in GraalVM SDK Javadoc:

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

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