GraalVM
   HOME

TheInfoList



OR:

GraalVM is a
Java VM A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describe ...
and
JDK The Java Development Kit (JDK) is a distribution of Java Technology by Oracle Corporation. It implements the Java Language Specification (JLS) and the Java Virtual Machine Specification (JVMS) and provides the Standard Edition (SE) of the Java ...
based on HotSpot/
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
, implemented in
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
. It supports additional
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
s and execution modes, like ahead-of-time compilation of Java applications for fast startup and low
memory footprint Memory footprint refers to the amount of main memory that a program uses or references while running. The word footprint generally refers to the extent of physical dimensions that an object occupies, giving a sense of its size. In computing, the ...
. The first production-ready version, GraalVM 19.0, was released in May 2019. The most recent version is GraalVM 22.1.0, made available in April 2022. Major differentiators of GraalVM compared to the base JDK are: * ''GraalVM Compiler'', a
JIT compiler In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may cons ...
for Java * ''GraalVM Native Image'', allowing the ahead-of-time compilation of Java applications * ''Truffle Language Implementation framework'' and the ''GraalVM SDK'', to implement additional programming language runtimes * ''LLVM Runtime'' and ''JavaScript Runtime''


Project goals

* To improve the performance of Java virtual machine-based languages to match the performance of native languages. * To reduce the startup time of JVM-based applications by compiling them ahead-of-time with GraalVM Native Image technology. * To enable GraalVM integration into the Oracle Database, OpenJDK, Node.js, Android/iOS, and to support similar custom embeddings. * To allow freeform mixing of code from any programming language in a single program, billed as "
polyglot Multilingualism is the use of more than one language, either by an individual speaker or by a group of speakers. It is believed that multilingual speakers outnumber monolingual speakers in the world's population. More than half of all Eu ...
applications". * To include an easily extended set of "
polyglot Multilingualism is the use of more than one language, either by an individual speaker or by a group of speakers. It is believed that multilingual speakers outnumber monolingual speakers in the world's population. More than half of all Eu ...
programming tool A programming tool or software development tool is a computer program that software developers use to create, debug, maintain, or otherwise support other programs and applications. The term usually refers to relatively simple programs, that can b ...
s".


History

GraalVM has its roots in the
Maxine Virtual Machine The Maxine virtual machine is an open source virtual machine that is developed at the University of Manchester. It was formerly developed by Sun Microsystems Laboratories, since renamed Oracle Labs. The emphasis in Maxine's software architecture ...
project at Sun Microsystems Laboratories (now Oracle Labs). The goal was to write a Java virtual machine in Java itself, hoping to free the development from the problems of developing in C++, particularly manual memory management, and benefit from meta-circular optimizations. Upon realizing that writing everything in Java was too ambitious as a first step, the decision was taken to focus on the compiler only and hook it into Hotspot, to reuse as much as possible the Hotspot runtime. The GraalVM compiler was started by manually
converting Converting companies are companies that specialize in modifying or combining raw materials such as polyesters, adhesives, silicone, adhesive tapes, foams, plastics, felts, rubbers, liners and metals, as well as other materials, to create new pro ...
the code of the Hotspot client compiler (named "C1") into Java, replacing the previous Maxine compiler. Graal was included in HotSpot-based
Java VM A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describe ...
releases like
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
from Java 9 through 15, in order to support experimental ahead-of-time compilation. It was removed in Java 16 as maintaining both the version in the JDK and the standalone GraalVM release caused duplicate effort. A similar functionality to create native executables from Java projects is provided by the ''native-image'' tool of standalone GraalVM releases.


Releases

GraalVM is available as Community Edition for an open-source license and as Oracle GraalVM Enterprise Edition accessible by accepting the "OTN License Agreement Oracle GraalVM Enterprise Edition Including License for Early Adopter Versions". Oracle Corporation announced the release of ''Oracle GraalVM Enterprise Edition'' on 8 May 2019. GraalVM can substitute a default JDK on Linux and macOS platforms on x86 64-bit systems.


GraalVM 22

GraalVM 22.1.0 GraalVM 22.1.0 was released in April 2022. GraalVM 22.0.0 GraalVM 22.0.0 was released in January 2022.


GraalVM 21


GraalVM 20

GraalVM 20.3.0 GraalVM 20.3.0 was released in November 2020. It was marked as the first LTS enterprise version of GraalVM and as the final release for 2020. This version supports code sharing in the GraalVM LLVM runtime, allowing the AST and compiled code of common bitcode libraries to be shared between multiple contexts within a single engine. GraalVM 20.1.0 GraalVM 20.1.0 was released in May 2020. It included several improvement for many of the components. Besides performance improvements, usability fixes for ''native-image'' were published. The JavaScript engine supports all ECMAScript 2020 mode features by default. The regular expression engine (''TRegex'') used by JavaScript and Python supports all expressions now. Ruby (''TruffleRuby'') improved in compatibility with native gems. GraalVM 20.0.0 GraalVM 20.0.0 was released in February 2020. It improved in its Windows support, brought an enhanced ''native-image'' tool and improved the tooling support, among many detailed changes in the compiler and supported languages.


GraalVM 19

GraalVM 19.0.0 The support on Windows is currently under development and released as an early adopter functionality in GraalVM 19.0. GraalVM 19.0 is based on top of JDK version 8u212.


Components

The GraalVM compiler is shipped with the components of a normal Java virtual machine (
OpenJDK OpenJDK (Open Java Development Kit) is a free and open-source implementation of the Java Platform, Standard Edition (Java SE). It is the result of an effort Sun Microsystems began in 2006. The implementation is licensed under the GPL-2.0-only w ...
). Additional components are included in GraalVM to support new execution modes (''GraalVM Native Image'') or programming languages (''LLVM runtime'', ''GraalVM JavaScript'' as a potential replacement to the deprecated
Nashorn ''Nashorn'' (, German for "rhinoceros"), initially known as ''Hornisse'' ( German "hornet"), was a German ''Panzerjäger'' ("tank hunter") of World War II. It was developed as an interim solution in 1942 by equipping a light turretless chassi ...
engine, ''TRegex'' as a
regular expression A regular expression (shortened as regex or regexp; sometimes referred to as rational expression) is a sequence of characters that specifies a search pattern in text. Usually such patterns are used by string-searching algorithms for "find" ...
engine).


GraalVM Compiler

The GraalVM Compiler is a modern Java
just-in-time compiler In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may cons ...
. It complements or replaces the existing compilers (C1/C2 in HotSpot). In contrast to those existing compilers, the GraalVM compiler is written in modular, maintainable and extendable fashion in Java itself. It is released under GPL version 2 with the
classpath exception A GPL linking exception modifies the GNU General Public License (GPL) in a way that enables software projects which provide library code to be " linked to" the programs that use them, without applying the full terms of the GPL to the using program. ...
.


GraalVM Native Image

GraalVM Native Image is an ahead-of-time compilation technology that produces executable binaries of class files. It is released as an early adopter plugin, which means it is production-ready but may include backport incompatible updates in the future releases. This functionality supports JVM-based languages, but can optionally execute dynamic languages, developed on top of GraalVM with Truffle framework. The executable file does not run on a JVM and uses necessary runtime components as thread scheduling or GC from “Substrate VM” - a trivial version of a virtual machine. Since the resulting native binary includes application classes, JDK dependencies and libraries already, the startup and execution time reduces significantly. GraalVM Native Image is officially supported by the Fn, Gluon, Helidon, Micronaut, Picocli,
Quarkus Quarkus is a Java (programming language), Java Software framework, framework tailored for deployment on Kubernetes. Key technology components surrounding it are HotSpot (virtual machine), OpenJDK HotSpot and GraalVM. The goal of Quarkus is to m ...
, Vert.x and
Spring Boot Spring(s) may refer to: Common uses * Spring (season), a season of the year * Spring (device), a mechanical device that stores energy * Spring (hydrology), a natural source of water * Spring (mathematics), a geometric surface in the shape of a ...
Java frameworks. In September 2016, Oracle detailed plans to add ahead-of-time compilation to the OpenJDK using the GraalVM compiler for Java 9. This proposal, tracked by the JEP 295: Ahead-of-Time Compilation, was included in Java 9. The experimental use of GraalVM as a
just-in-time compiler In computing, just-in-time (JIT) compilation (also dynamic translation or run-time compilations) is a way of executing computer code that involves compilation during execution of a program (at run time) rather than before execution. This may cons ...
was added for the
Linux Linux ( or ) is a family of open-source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991, by Linus Torvalds. Linux is typically packaged as a Linux distribution, which ...
x86-64 x86-64 (also known as x64, x86_64, AMD64, and Intel 64) is a 64-bit version of the x86 instruction set, first released in 1999. It introduced two new modes of operation, 64-bit mode and compatibility mode, along with a new 4-level paging ...
platform for Java 10. In JDK releases 9 to 15, the command creates a Native Image. The experimental flag enables the use of Graal JIT. The functionality is since available in the ''native-image'' component of standalone GraalVM releases.


Truffle Language Implementation Framework

In association with GraalVM, Oracle Labs developed a language
abstract syntax tree In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the abstract syntactic structure of text (often source code) written in a formal language. Each node of the tree denotes a construct occurring ...
interpreter called "Truffle" which would allow it to implement languages on top of the GraalVM. Many languages have been implemented in Truffle, including a C interpreter claiming to be about as fast as GCC and
Clang Clang is a compiler front end for the C, C++, Objective-C, and Objective-C++ programming languages, as well as the OpenMP, OpenCL, RenderScript, CUDA, and HIP frameworks. It acts as a drop-in replacement for the GNU Compiler Collection ...
. The Truffle framework and its dependent part, GraalVM SDK, are released under the
Universal Permissive License Universal is the adjective for universe. Universal may also refer to: Companies * NBCUniversal, a media and entertainment company ** Universal Animation Studios, an American Animation studio, and a subsidiary of NBCUniversal ** Universal TV, a ...
, version 1.0, to encourage use of the framework for projects which do not want to be bound by the copyright or other parent rights.


Instrumentation-based Tool Support

A major advantage of the GraalVM ecosystem is
language-agnostic Language-agnostic programming or scripting (also called language-neutral, language-independent, or cross-language) is a software paradigm in which no particular language is promoted. In introductory instruction, the term refers to teaching princip ...
, fully dynamic
instrumentation Instrumentation a collective term for measuring instruments that are used for indicating, measuring and recording physical quantities. The term has its origins in the art and science of scientific instrument-making. Instrumentation can refer to ...
support built-in directly into the VM runtime. Execution events can be captured by
API An application programming interface (API) is a way for two or more computer programs to communicate with each other. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how ...
clients with overhead that is extremely low in fully optimized code. The core GraalVM installation provides a language-agnostic debugger, profiler, heap viewer, and others based on instrumentation and other VM support. GraalVM also includes a backend implementation of the Chrome Inspector remote debugging protocol. Although designed originally for JavaScript debugging, it can be used to debug all GraalVM languages from a browser.


Language and Runtime Support

GraalVM is written in and for the
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
ecosystem. It can execute applications written in all languages that compile to the
Java bytecode In computing, Java bytecode is the bytecode-structured instruction set of the Java virtual machine (JVM), a virtual machine that enables a computer to run programs written in the Java programming language and several other programming langua ...
format, e.g. Java, Scala, Kotlin, and more. Based on Truffle Language Implementation framework additional languages can be supported in GraalVM. * GraalVM JavaScript:
ECMAScript ECMAScript (; ES) is a JavaScript standard intended to ensure the interoperability of web pages across different browsers. It is standardized by Ecma International in the documenECMA-262 ECMAScript is commonly used for client-side scripting o ...
2021 compliant JavaScript runtime, with support for
Node.js Node.js is an open-source server environment. Node.js is cross-platform and runs on Windows, Linux, Unix, and macOS. Node.js is a back-end JavaScript runtime environment. Node.js runs on the V8 JavaScript Engine and executes JavaScript code o ...
* TruffleRuby:
Ruby A ruby is a pinkish red to blood-red colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sa ...
language implementation with preliminary support for
Ruby on Rails Ruby on Rails (simplified as Rails) is a server-side web application framework written in Ruby under the MIT License. Rails is a model–view–controller (MVC) framework, providing default structures for a database, a web service, and we ...
* FastR: R language implementation * GraalVM Python:
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
3 language implementation * GraalVM LLVM Runtime (''SuLong''):
LLVM LLVM is a set of compiler and toolchain technologies that can be used to develop a front end for any programming language and a back end for any instruction set architecture. LLVM is designed around a language-independent intermediate repre ...
bitcode interpreter implementation * GraalWasm: A
WebAssembly WebAssembly (sometimes abbreviated Wasm) defines a portable binary-code format and a corresponding text format for executable programs as well as software interfaces for facilitating interactions between such programs and their host environment ...
implementation Support for additional languages can be implemented by users of GraalVM. Some notable third-party language implementations are grCuda, SOMns, TruffleSqueak, and Yona.Yona Language
/ref>


References


External links

{{Oracle FOSS Cross-platform software Java compilers Java platform software Java virtual machine Oracle software Stack-based virtual machines