GraalVM
GraalVM is a high-performance Java Development Kit (JDK) distribution developed by Oracle Labs, featuring the Graal compiler for just-in-time (JIT) optimization and ahead-of-time (AOT) native image compilation to produce standalone executables that start instantly, consume minimal memory, and enhance application efficiency across cloud-native and embedded environments.[1][2] Originating from research at Oracle Labs in Zurich on advanced dynamic compilers beginning around 2011, GraalVM evolved from the Graal project—a Java-based replacement for the traditional HotSpot C++ compiler—and reached its first production-ready release, version 19.0, in May 2019, supporting Java 8 and 11 with initial polyglot capabilities.[3][4] The platform supports polyglot programming, allowing seamless interoperability between languages such as Java, JavaScript (via GraalJS), Python (via GraalPy), Ruby, R, and WebAssembly, all running on a shared runtime that optimizes code execution through partial evaluation and truffle framework abstractions.[1] Key features include Native Image technology, which statically analyzes and compiles applications into compact binaries without a JVM at runtime, reducing startup time by up to 50x (from seconds to milliseconds) and memory footprint by up to 5x compared to traditional JVMs; this is particularly beneficial for microservices, serverless functions, and edge computing.[1][5][6] GraalVM integrates with popular Java frameworks like Spring Boot and Quarkus via Maven and Gradle plugins, and its community edition is based on OpenJDK while the enterprise version offers advanced optimizations and support; as of September 2025, version 25 aligns with JDK 25, decoupling from the strict six-month Java release cadence for more flexible updates.[1][7][8] Widely adopted by organizations including Twitter (now X), Alibaba, and Disney for production workloads, GraalVM continues to advance through open-source contributions on GitHub, emphasizing security enhancements like reduced attack surfaces in native executables and compatibility with tools such as JUnit for testing.[9][2][10]Goals and Overview
Primary Objectives
GraalVM aims to serve as a universal virtual machine that supports just-in-time (JIT) compilation, ahead-of-time (AOT) compilation, and interpretation for Java and other programming languages, enabling high-performance execution across diverse environments.[11] This multifaceted approach allows developers to choose the optimal execution mode based on application needs, with JIT leveraging the Graal compiler for dynamic optimizations during runtime, AOT producing native executables for instant startup without warmup, and interpretation facilitating rapid prototyping and scripting in supported languages.[12] By integrating these capabilities into a single runtime, GraalVM seeks to unify the execution model traditionally fragmented across language-specific virtual machines.[13] A core objective of GraalVM is to reduce resource consumption, including CPU and memory usage, while accelerating application performance through advanced compiler optimizations such as profile-guided optimization, aggressive inlining, and partial escape analysis.[11] These techniques enable native executables that use a fraction of the resources required by traditional JVM-based applications, often achieving up to 100x faster startup times and significantly lower peak memory footprints.[12] For instance, by eliminating the need for JIT warmup and minimizing garbage collection overhead with tools like the G1 collector, GraalVM optimizes for efficiency in cloud-native and resource-constrained deployments.[11] GraalVM's design emphasizes seamless polyglot programming, aiming to eliminate overhead in inter-language calls by providing a shared runtime where components from different languages can interact with near-native speed.[12] This is achieved through the Truffle framework, which allows embedding languages like JavaScript or Python directly into Java applications, enabling fine-grained access to host resources without performance penalties from context switching or marshalling.[13] The objective is to foster hybrid applications where developers can leverage the strengths of multiple languages within a cohesive ecosystem. Motivated by the need for a more modular and extensible runtime, GraalVM is engineered to replace or augment traditional JVMs like HotSpot, offering pluggable components such as the Graal JIT compiler that can integrate with existing Java ecosystems.[12] This modularity supports custom configurations, including build-time linking for compact binaries and compatibility with standard Java tools like JFR and JMX, ultimately aiming to evolve the JVM landscape toward greater flexibility and maintainability.[11]Key Benefits
GraalVM's Native Image technology enables ahead-of-time (AOT) compilation of Java applications into standalone executables, dramatically reducing startup times—up to 100 times faster in some cases, such as from 3.6 seconds to under 100 milliseconds for serverless functions—and minimizing memory footprints by eliminating JVM overhead during runtime.[12][11] These improvements make GraalVM particularly suitable for cloud-native and serverless environments, where rapid scaling and low-latency responses are critical, allowing applications to deploy more efficiently without the warmup delays typical of traditional JVMs.[12] In just-in-time (JIT) mode, the Graal compiler delivers higher peak performance compared to the HotSpot C2 compiler, with optimizations such as partial escape analysis enabling up to 50% faster execution in select benchmarks by more effectively eliminating unnecessary object allocations and improving scalar replacement.[14][15] This enhanced throughput supports demanding workloads while maintaining compatibility with standard Java applications. By lowering CPU utilization, GraalVM reduces infrastructure costs; for instance, Twitter's adoption resulted in approximately 10% decreased CPU usage across thousands of JVM instances without requiring code changes, leading to substantial savings at scale.[9] GraalVM enhances developer productivity through its polyglot capabilities, allowing seamless interoperability between languages like Java, JavaScript, and Python via the Truffle framework, which provides direct object sharing and method invocation without the overhead of traditional foreign function interfaces (FFI).[16][17] This enables developers to embed and extend applications with multiple languages effortlessly, streamlining polyglot development workflows.History and Development
Origins
The origins of GraalVM lie in the Maxine Virtual Machine project, launched at Sun Microsystems Laboratories in the mid-2000s to construct a Java virtual machine entirely implemented in Java, fostering a meta-circular design that simplified research, debugging, and extension compared to traditional C++-based VMs.[18] This initiative emphasized approachability for developers and researchers, enabling self-hosting and introspection features that blurred the lines between application code and VM internals. Sun Microsystems was acquired by Oracle Corporation on January 27, 2010, transferring the Maxine project to Oracle Labs and integrating it into broader Java ecosystem efforts. Building on Maxine, Graal compiler research commenced around 2011 at Oracle Labs, targeting the creation of a high-performance just-in-time (JIT) compiler written in Java to serve as a viable alternative to the HotSpot JVM's longstanding C++ codebase, which posed maintenance and extensibility challenges.[19] The initial Graal prototype integrated with both Maxine and HotSpot via the JVM Compiler Interface (JVMCI), allowing Java libraries to contribute optimizations and enabling finer-grained analysis of library code during compilation.[19] From 2012 to 2015, development prioritized modularity and extensibility, evolving the project from research prototypes into deployable tools suitable for production JVM integration. Key advancements included a graph-based intermediate representation (IR) that supported declarative, extensible optimizations, separating concerns like control-flow modeling from backend code generation to enhance reusability across VMs.[20] This modular architecture facilitated easier experimentation with advanced features, such as partial evaluation and profile-guided optimizations, while maintaining compatibility with HotSpot's infrastructure.[21] In 2016, Oracle Labs open-sourced core Graal components under the GNU General Public License version 2 with Classpath Exception, releasing the Graal compiler and related modules on GitHub to encourage community contributions and broader adoption in the Java ecosystem.[22]Major Milestones
GraalVM was launched as a distinct project by Oracle Labs in 2018 with the release of version 1.0 in April, integrating the Graal just-in-time compiler with the Truffle framework to provide polyglot programming capabilities across languages like Java, JavaScript, Ruby, Python, and R on a single virtual machine.[23] This integration enabled seamless interoperability between languages without performance overhead, marking a significant advancement in multi-language runtime support.[24] A pivotal milestone occurred in May 2019 with the release of GraalVM 19.0, the first production-ready version that introduced a stable Native Image tool for ahead-of-time (AOT) compilation of Java applications into standalone executables.[3] This release stabilized the experimental features from earlier versions, allowing developers to deploy lightweight binaries with reduced startup times and memory footprints, facilitating broader adoption in cloud-native and microservices environments.[25] In October 2021, GraalVM 21.3 added official support for Java 17 LTS, enhancing enterprise adoption through improved Native Image performance, including better peak throughput and reduced compilation times for AOT builds.[26] This update also incorporated JDK Flight Recorder for profiling native executables, underscoring GraalVM's maturation as a reliable platform for production workloads.[27] GraalVM underwent a major evolution in 2023 with the adoption of JDK-aligned versioning, starting with GraalVM for JDK 21 as a long-term support (LTS) release in September, synchronizing its cadence with OpenJDK's six-month cycle.[7] Concurrently, Oracle renamed the Enterprise Edition to Oracle GraalVM and made it freely available under the GraalVM Free Terms and Conditions (GFTC), eliminating previous per-processor licensing costs and broadening accessibility for production use.[28] This licensing shift, effective from June 2023, included support for JDK 17 and JDK 20 onward, promoting wider community and commercial deployment.[29] By September 2025, GraalVM 25 was released, emphasizing enhancements to Native Image technology such as faster build times and expanded platform support, while detaching from strict Java ecosystem alignment to prioritize standalone native compilation across diverse runtimes.[30] This milestone reflected GraalVM's strategic pivot toward broader applicability beyond Java-centric environments, with GraalVM for JDK 24 marking the final integration within Oracle Java SE products.[8]Editions
Community Edition
The GraalVM Community Edition is the open-source distribution of GraalVM, built on OpenJDK and designed for developers seeking a free, modifiable runtime environment. It enables the compilation and execution of applications in Java and other languages, supporting both just-in-time (JIT) compilation via the Graal compiler and ahead-of-time (AOT) native image generation.[31][2] Licensed under the GNU General Public License version 2 with the Classpath Exception, the Community Edition permits free use, modification, and redistribution without royalties, aligning with OpenJDK's licensing model to foster broad adoption in non-commercial and open-source projects. This licensing ensures compatibility with the Java ecosystem while allowing integration into diverse software distributions.[31][2] The edition incorporates core components such as the Graal compiler for optimized JIT execution, Native Image for creating standalone executables, and the Truffle framework for building polyglot applications, though it provides baseline performance optimizations without proprietary enhancements. These features support development of high-performance applications across multiple languages, including Java, JavaScript, Python, and Ruby, via the Polyglot API.[11][2] GraalVM Community Edition binaries are available for download from the official GitHub repository at graalvm/graalvm-ce-builds, offering pre-built installers and container images for Linux, macOS, and Windows operating systems on both x86-64 and AArch64 architectures. Installation is straightforward via archive files, SDKMAN!, or Docker, with support for the latest OpenJDK versions such as JDK 25 as of late 2025.[32][33][34] Development of the Community Edition is community-driven, with contributions welcomed through GitHub pull requests to the oracle/graal repository, enabling enhancements from industry, academia, and individual developers. Updates follow a flexible release schedule, decoupled from OpenJDK's six-month cadence since September 2025, including critical patch updates for security, but without dedicated commercial support; users rely on public forums, mailing lists, and issue trackers for assistance. Compared to Oracle GraalVM, the Community Edition offers solid baseline performance suitable for most use cases, though it lacks advanced tuning options available in the proprietary variant.[35][2][7]Oracle GraalVM
Oracle GraalVM is Oracle's distribution of the GraalVM high-performance runtime, licensed under the GraalVM Free Terms and Conditions (GFTC) since June 2023 for free use, including in production, and free redistribution. It is built upon the Oracle JDK and provides access to advanced features and support as part of the Java SE Universal Subscription.[36][31][28] This model supports enterprise customers seeking integrated support within Oracle's ecosystem, particularly for deploying applications on Oracle Cloud Infrastructure.[37] A key distinction of Oracle GraalVM lies in its proprietary optimizations for Native Image, which enable the ahead-of-time compilation of Java applications into standalone executables with enhanced performance characteristics not available in the Community Edition. For instance, it includes Profile-Guided Optimization (PGO), which can accelerate startup times and improve throughput by leveraging runtime profiles to refine compilation decisions.[5] Additionally, advanced static analysis techniques, such as improved points-to and reachability reporting, aid in reducing image size and memory footprint through more precise identification of used code paths. Oracle GraalVM also incorporates the G1 garbage collector option for Native Images on supported platforms, further optimizing resource usage for long-running applications.[5] Beyond performance enhancements, Oracle GraalVM features closed-source additions tailored for enterprise needs, including advanced telemetry and diagnostics for monitoring and troubleshooting in production environments.[38] A notable capability is the automatic generation of Software Bill of Materials (SBOM) in CycloneDX format during Native Image builds, facilitating vulnerability scanning, compliance auditing, and supply chain security assessments.[39] These elements integrate seamlessly with Oracle Cloud services, supporting secure deployment of microservices and serverless functions with extended logging and tracing tools. While compatible with the same platforms as the Community Edition (such as Linux, Windows, and macOS on x64 and aarch64 architectures), Oracle GraalVM extends diagnostics through proprietary tools for deeper runtime insights.[40] In 2023, Oracle GraalVM emerged as the successor to GraalVM Enterprise Edition, marking a strategic pivot toward emphasizing Native Image for cloud-native workloads over earlier focuses on just-in-time (JIT) compilation enhancements.[41] This evolution aligns with growing demands for low-latency, resource-efficient applications in containerized and serverless environments, positioning Oracle GraalVM as a cornerstone for Oracle's cloud development offerings. It shares core components, like the Graal compiler and Truffle framework, with the Community Edition, as explored in the Core Components section.[41]Core Components
Graal Compiler
The Graal Compiler is a dynamic just-in-time (JIT) compiler written entirely in Java, designed to transform Java bytecode into optimized machine code at runtime. It serves as a drop-in replacement for the HotSpot JVM's traditional C2 compiler, integrating seamlessly through the Java Virtual Machine Compiler Interface (JVMCI), which allows it to be invoked by the HotSpot VM without requiring modifications to the JVM core. This architecture enables Graal to leverage the mature HotSpot infrastructure while introducing advanced compilation techniques tailored for modern workloads.[42] Graal supports a range of sophisticated optimizations to enhance performance, including speculative optimizations that assume certain program behaviors based on runtime profiles and revert via deoptimization if assumptions fail. For instance, it employs partial escape analysis to eliminate unnecessary object allocations by speculatively determining object lifetimes. Additionally, profile-guided inlining decisions enable aggressive and polymorphic inlining, where method calls are replaced with their bodies based on observed invocation patterns, reducing overhead and exposing further optimization opportunities. Deoptimization mechanisms ensure robustness by allowing the compiler to fall back to slower but safer execution paths when speculative assumptions are invalidated, maintaining correctness across diverse execution scenarios.[42][43][44][45] The compiler's modular design facilitates partial evaluation, where portions of the program are specialized based on known inputs during compilation, and supports tiered compilation pipelines that progress from interpretation to lightweight C1 compilation and finally to full Graal optimization. This tiered approach allows for quick initial execution while reserving intensive optimizations for frequently executed "hot" code paths, balancing startup time and peak performance. Furthermore, Graal integrates with the Truffle framework to provide language-agnostic JIT compilation, using a shared graph-based intermediate representation that enables high-performance execution of polyglot applications by optimizing across language boundaries without custom per-language backends.[42][43]Native Image
Native Image is a key technology in GraalVM that enables ahead-of-time (AOT) compilation of Java bytecode, along with its dependencies, into a standalone native executable binary.[46] This process transforms the application into a self-contained program that runs directly on the host operating system without requiring a Java Virtual Machine (JVM) at runtime.[46] The core of Native Image relies on static analysis, particularly points-to analysis, to determine all reachable classes, methods, fields, and objects from the application's entry points.[47] This analysis identifies the exact code and data needed during execution, excluding any unused components to produce a lean binary.[46] Operating under a closed-world assumption—where all possible code paths and dependencies are assumed to be fully known at build time—the tool performs this ahead-of-time compilation, linking the optimized code with a lightweight runtime substitute for the full JDK.[46] Native Image delivers substantial efficiency gains, particularly in startup time and resource consumption. Executables start in milliseconds—often under 10 ms for simple applications—contrasting with the seconds required for JVM warm-up, making it ideal for cloud-native deployments like microservices and functions-as-a-service.[46] Peak memory usage is also dramatically lower; for instance, a basic Hello World program compiled as a native image peaks at approximately 7.6 MB of resident set size (RSS), representing a small fraction of typical JVM heap requirements.[46] To accommodate dynamic Java features that challenge static analysis, such as reflection, dynamic class loading, resource access, JNI calls, and proxy creation, users configure the build via metadata files in JSON format.[48] These files explicitly declare elements like reflective accessors or proxy interfaces, ensuring their inclusion without violating the closed-world assumption or bloating the binary.[48] In GraalVM 25, released in 2025, Native Image saw enhancements to points-to analysis precision through the default enablement of Whole-Program Sparse Conditional Constant Propagation (WP-SCCP), which improves scalability and can reduce binary sizes by better propagating constants across the program.[49] Support for dynamic proxies was refined via advanced obfuscation that preserves essential names guided by reachability metadata and annotations.[50] The Graal Compiler contributes to these optimizations by generating high-performance machine code during the AOT phase.[46]Truffle Framework
The Truffle framework is an open-source library designed for implementing high-performance interpreters for programming languages on the Java Virtual Machine (JVM). It enables developers to build language runtimes as modular Java libraries that interpret programs using self-modifying Abstract Syntax Trees (ASTs), which are automatically optimized and just-in-time (JIT) compiled by the Graal compiler. This AST-based approach allows interpreters to start with a simple, high-level structure that evolves through runtime profiling and deoptimization, achieving near-native performance without manual low-level optimizations.[51][52] Key features of Truffle include partial evaluation, which specializes the interpreter code based on observed program behavior to eliminate unnecessary computations, and speculative optimizations that assume certain conditions (such as type stability) and fall back via deoptimization if assumptions fail. These mechanisms facilitate the transfer of optimizations across polyglot programs by sharing common AST node types and leveraging the Graal compiler's interprocedural analysis. Languages implemented with Truffle can thus benefit from cross-language inlining and constant folding, enhancing overall system performance in multi-language environments.[51][52] Truffle supports metacircular execution of JVM languages through "Java on Truffle," also known as Espresso, which reimplements the Java Virtual Machine as a Truffle-based interpreter. This allows Java bytecode to run interpretively on Truffle ASTs, enabling seamless polyglot integration where Java acts as both host and guest language, with full access to Truffle's optimization infrastructure.[53] To simplify development, Truffle includes domain-specific languages (DSLs) for generating interpreter components; notably, the Truffle Bytecode DSL, introduced in GraalVM 24.2, automates the creation of optimizing bytecode interpreters from high-level operation definitions, reducing boilerplate code while preserving Truffle's self-optimization capabilities.[54][55]Polyglot API and Tooling
The Polyglot API, part of theorg.graalvm.polyglot package in the GraalVM SDK, enables Java applications to embed and interact with multiple guest languages supported by GraalVM.[56] It provides classes such as Context for managing the global runtime state of installed languages and Engine for controlling shared resources like the JIT compiler across multiple contexts.[57] Developers create a Context instance using Context.create(String...) to specify permitted languages, then execute guest code via methods like Context.eval(Source, String mimeType), which returns a Value object representing the result.[56] Interoperability between languages is handled through the Value interface, allowing seamless passing of objects, primitives, and functions across language boundaries without explicit marshalling, as the API abstracts the underlying Truffle-based representations.[16]
The instrumentation framework in GraalVM, built on the Truffle API (com.oracle.truffle.api.instrumentation), supports profiling and monitoring of polyglot execution by allowing tools to attach listeners to abstract syntax tree (AST) nodes and execution events.[58] Tools implement TruffleInstrument to access an Instrumenter from the language environment, enabling event notifications for node execution, source section coverage, and allocation tracking across all languages in a polyglot context.[59] This framework facilitates AST visualization by exposing node structures for inspection and supports guest language breakpoints through SourceSectionFilter configurations, where instruments can suspend execution at specific source locations in any Truffle-implemented language.[58] Although not directly based on JVMTI, it extends Java-level introspection for low-overhead, language-agnostic profiling, as detailed in foundational work on polyglot instrumentation support.[60]
GraalVM provides specialized tools for analyzing and debugging polyglot applications. The Ideal Graph Visualizer (IGV) is a desktop application for examining Graal compiler graphs generated during polyglot execution, particularly useful for Truffle language developers to inspect intermediate representations from ASTs to machine code.[61] Users enable graph dumps via JVM options like -Dgraal.Dump=:1 and view them in IGV to analyze optimization phases, node interactions, and performance bottlenecks in mixed-language scenarios.[61] For debugging, GraalVM integrates with the Chrome DevTools Protocol, allowing Truffle languages to be inspected using Chrome's developer tools for setting breakpoints, stepping through code, and examining variables in guest languages like JavaScript or Ruby.[62] Launch applications with --inspect to expose a WebSocket endpoint (default port 9229), then connect via Chrome at the provided devtools:// URL for polyglot-aware debugging sessions.[62]
Introduced in GraalVM 22.0, polyglot isolates enable running guest languages in fully isolated contexts to enhance security and prevent interference between executions.[63] Each isolate operates as a separate Native Image process with its own garbage collector and JIT compiler, configurable via Engine options like --engine.SpawnIsolate=true.[63] This feature requires language-specific isolate artifacts (e.g., js-isolate for JavaScript) on the classpath and supports scoped host access policies to limit interactions, making it suitable for sandboxed environments.[64] Available initially for JavaScript in GraalVM for JDK 21 and later, it extends to other languages like Python from version 24.1, providing a robust mechanism for secure polyglot embedding. As of GraalVM 25.0, WebAssembly is supported as a polyglot isolate named wasm-isolate.[63][65]
Language Support
JVM Languages
GraalVM serves as a drop-in replacement for the standard Java HotSpot VM, providing full compatibility for applications written in Java across supported JDK versions including 17, 21, and 25. This includes support for the Java Platform Module System (JPMS), enabling modularized applications to run without modifications, as well as recent language features like virtual threads introduced in JDK 21 for lightweight concurrency.[66][49][67][68] Through integration with the Java Virtual Machine Compiler Interface (JVMCI), GraalVM delivers optimized just-in-time (JIT) compilation for popular JVM languages such as Scala, Kotlin, and Groovy, leveraging the Graal compiler to achieve superior peak performance over traditional HotSpot optimizations by reducing object allocations and enabling aggressive inlining.[66][42] Clojure and other JVM languages similarly run on GraalVM with enhanced efficiency, particularly benefiting from partial escape analysis that identifies non-escaping objects to minimize heap allocations and thereby reduce garbage collection pauses.[69][42] GraalVM's Native Image capability extends compatibility to JVM applications by compiling them ahead-of-time into standalone native executables, while accommodating dynamic behaviors like serialization through explicit reachability metadata registration for classes implementing theSerializable interface.[48] This metadata ensures proper handling of reflection and proxy classes during deserialization, making it suitable for cloud-native deployments of JVM-based code.[48]
Truffle-Based Languages
The Truffle framework enables the implementation of high-performance interpreters for various programming languages on GraalVM, allowing them to execute efficiently alongside other languages through partial evaluation and just-in-time compilation. These Truffle-based languages are primarily non-JVM runtimes, focusing on extensibility and polyglot integration without relying on bytecode interpretation. Key implementations include GraalJS for JavaScript, GraalPy for Python, TruffleRuby for Ruby, FastR for R, as well as support for WebAssembly and LLVM bitcode, with experimental languages like SimpleLanguage demonstrating the framework's versatility.[70] GraalJS provides a high-performance, ECMAScript-compliant runtime for JavaScript, supporting the full ECMAScript 2025 specification, verified through the test262 suite and compatibility tables. It offers compatibility with Node.js applications, passing a significant portion of Node.js unit tests, and achieves V8-comparable performance after warmup in JVM mode, where peak execution speeds approach those of the V8 engine in benchmarks like Octane and JetStream. In native mode, GraalJS emphasizes fast startup times suitable for serverless environments, though with slightly lower peak performance than JVM mode.[71][72] GraalPy serves as a compliant Python 3.12 runtime with strong CPython compatibility, including support for a subset of popular libraries such as NumPy and SciPy for data science tasks, as well as partial integration with PyTorch and Hugging Face Transformers. It delivers approximately 4x faster execution than CPython on the official Python Performance Benchmark Suite when JIT-compiled, leveraging GraalVM's optimizations for numerical computations and object-oriented code. Additionally, GraalPy enables rapid startup in Native Image mode, reducing initialization overhead for embedded use cases compared to traditional CPython interpreters.[73][74][75][65] TruffleRuby implements a high-performance Ruby runtime compatible with MRI 3.3, including support for web frameworks like Rails and many gems with C extensions, aiming for full MRI compatibility over time. It optimizes Ruby's dynamic features through Truffle's AST interpretation and Graal compilation, providing faster execution for concurrency-heavy applications and Rails workloads compared to standard MRI, with reduced memory footprint in polyglot scenarios. TruffleRuby's design facilitates seamless integration with other Truffle languages while maintaining Ruby's idiomatic semantics.[76][55] FastR offers a GNU R-compatible runtime based on R 4.3, supporting base R packages and select extensions for statistical computing, with high performance derived from GraalVM's JIT compilation for vectorized operations and loops common in data analysis; FastR entered maintenance mode in 2024. It executes R scripts faster than vanilla GNU R in compute-intensive tasks, such as matrix operations, while enabling polyglot workflows with languages like Python for mixed analytics pipelines. FastR's Truffle-based interpreter ensures low-latency REPL interactions and efficient handling of R's functional paradigms.[77][78][79][80] GraalVM supports WebAssembly through GraalWasm, a runtime compliant with WebAssembly 2.0 and extensions like WASI, allowing execution of WASM modules compiled from languages such as Rust or C in binary format without browser dependencies. This enables portable native extensions in polyglot applications, with performance optimizations for ahead-of-time compilation and interoperability via Truffle's object model. For LLVM bitcode, the Sulong interpreter executes code from languages like C, C++, and Fortran, transforming bitcode into Truffle ASTs for Graal optimization, though it requires pre-compilation to LLVM IR rather than direct source support. Experimental languages, such as the tutorial SimpleLanguage, illustrate Truffle's ease of implementation for custom interpreters, often achieving near-native speeds post-compilation.[81][82][83]Features and Capabilities
Embedding Languages
GraalVM's Polyglot API facilitates the integration of guest languages into host applications, such as those written in Java, by leveraging the Polyglot Context to establish isolated execution environments for guest code.[63] A Polyglot Context encapsulates the global runtime state for all permitted languages within it, enabling the evaluation of guest scripts or expressions while maintaining separation from the host application's state.[57] By default, each context operates with its own isolated engine, which can be shared across multiple contexts to optimize resource usage like code caching, ensuring that compiled guest code is reused without reparsing sources.[84] This isolation supports secure embedding, particularly in scenarios where untrusted guest code must run without compromising the host.[64] To enable data exchange between host and guest languages, GraalVM employs the Value API, which binds values seamlessly without the overhead of explicit marshalling.[85] The Value interface represents polyglot values accessible via language-agnostic operations, supporting primitive types, host objects, and proxies that allow guest code to invoke host methods or access fields directly.[63] For instance, a Java host can pass objects to a guest language like JavaScript, where public methods and fields become available as members, facilitating bidirectional interoperability through polyglot bindings that exchange symbols between environments.[57] This approach ensures efficient, transparent value passing, as host languages can directly manipulate guest values embedded in the application.[63] Configuration of the Polyglot Context occurs during its creation, allowing fine-tuned control over language options and execution constraints.[57] Using the Context.Builder, developers can specify permitted languages, enable features like script engines for dynamic evaluation, and impose resource limits such as CPU time or memory allocation to prevent excessive consumption by guest code.[64] By default, the API restricts access to sensitive host functionalities like file I/O, but these can be adjusted—such as by settingallowIO(true) or using @HostAccess annotations—to balance security and functionality, with inner contexts inheriting outer limits for nested executions.[63] Sandbox policies, including ISOLATED for basic restrictions and UNTRUSTED for enhanced mitigation of untrusted code risks, further enforce these configurations at the context level.[64]
When building native executables that embed guest languages, GraalVM's Native Image tool incorporates the necessary components through reachability metadata to support dynamic features at runtime.[63] Developers generate metadata files, such as reachability-metadata.[json](/page/JSON) placed in META-INF/native-image/<group-id>/, to register reflection, resources, and proxies required for polyglot interactions, ensuring that language runtimes and code caches are included without manual intervention.[48] This metadata enables the polyglot engine to operate within a dedicated Native Image isolate, providing VM-level isolation and efficient execution of embedded guest code in ahead-of-time compiled binaries.[63]
Polyglot Programming
GraalVM enables polyglot programming by allowing applications to integrate multiple programming languages within a single runtime environment, leveraging the Truffle framework to facilitate direct interoperability without the overhead typically associated with foreign function interfaces. This approach supports seamless value passing and function calls across languages, such as a Java application invoking JavaScript functions or Python code calling Java methods, achieved through a standardized polyglot interoperability protocol that exposes objects, methods, and primitives uniformly. The protocol ensures zero-overhead interop by executing all code in the same memory space, eliminating marshalling costs and enabling the Graal compiler to optimize cross-language interactions as if they were monolingual.[86][21] In practice, developers can evaluate guest language code from a host language using APIs likeContext.eval in Java, for instance, creating a JavaScript array from Java with polyglot.eval("js", "[1,2,42,4]") and accessing its elements directly. This bidirectional capability extends to more complex scenarios, such as Python scripts invoking Java libraries for performance-critical computations or JavaScript defining domain-specific languages (DSLs) embedded in Java applications for configuration scripting. A notable use case is in data science pipelines, where Java backend services integrate R for statistical analysis or Python for machine learning, as demonstrated by the Dutch National Police's collaboration between data scientists and developers running R code within Java environments to process large datasets efficiently.[86][10]
Cross-language handling of exceptions, threads, and I/O is unified through the Polyglot API, which propagates errors as PolyglotException instances that include stack traces from both host and guest languages, allowing centralized error management. Threads are managed via context binding, with options to enforce single-threaded execution for languages like JavaScript to avoid concurrency issues, while I/O operations use shared streams configurable through Context builders (e.g., allowIO(true)). For optimization, GraalVM shares compilation units across languages via the Graal compiler's partial evaluation, enabling techniques like inlining and devirtualization of interop calls; engine modes such as --engine.Mode=throughput maximize profiling to achieve peak performance by compiling shared hot paths once for all involved languages.[87][86][88]
Releases
Version History
GraalVM's development began with its initial release in April 2018 as version 1.0, an experimental polyglot virtual machine supporting Java and select JVM languages alongside early implementations for JavaScript, Ruby, Python, and R via the Truffle framework.[23] This version focused on demonstrating high-performance just-in-time compilation across languages but was not intended for production use, with non-JVM language support marked as experimental.[24] The project advanced to its first production-ready release with GraalVM 19.0 on May 9, 2019, introducing stable Native Image capabilities for ahead-of-time compilation of Java applications into standalone executables, alongside mature polyglot interoperability.[3] Subsequent updates in the 19.x series, such as 19.0.2 in June 2019, addressed compilation performance and bug fixes to solidify its foundation for enterprise adoption.[89] In the JDK 17 era, GraalVM 21.3 arrived on October 19, 2021, as a long-term support release aligned with OpenJDK 17, providing full Java 17 compatibility and enhanced Native Image performance optimizations.[27] This version marked a milestone for production deployments requiring LTS stability, with ongoing quarterly updates. Following in October 2022, GraalVM 22.3 introduced enhancements to the Truffle framework, including improved polyglot runtime efficiency and support for JDK 19 features like virtual threads in preview.[90] From 2023 onward, GraalVM transitioned to JDK version-based numbering to align with OpenJDK's six-month release cadence, starting with GraalVM for JDK 21 on September 19, 2023, an LTS distribution incorporating Java 21 innovations such as virtual threads and pattern matching.[91] This shift facilitated closer integration with upstream JDK developments. More recent releases include GraalVM for JDK 24.0.2 on July 15, 2025, delivering security fixes and performance refinements via the quarterly Critical Patch Update.[92] GraalVM for JDK 25 followed on September 16, 2025, featuring Native Image precision improvements for better resource usage and experimental advanced obfuscation capabilities.[49] The October 2025 Critical Patch Update, GraalVM 25.0.1, was released on October 21, 2025, incorporating security fixes from the corresponding OpenJDK update.[49] GraalVM maintains a quarterly release rhythm for Critical Patch Updates on the third Tuesday of January, April, July, and October, ensuring security patches and minor enhancements across active branches without introducing new features.[7]| Key Release | Date | Major Innovations |
|---|---|---|
| 1.0 | April 2018 | Experimental polyglot support |
| 19.0 | May 2019 | Production Native Image |
| 21.3 | October 2021 | JDK 17 LTS alignment |
| 22.3 | October 2022 | Truffle enhancements, JDK 19 support |
| JDK 21 | September 2023 | JDK 21 LTS features |
| JDK 24.0.2 | July 2025 | CPU security updates |
| JDK 25 | September 2025 | Native Image precision improvements |
| 25.0.1 | October 2025 | Critical Patch Update with security fixes |