1 of 11

Jaroslav Tulach | GraalVM Community Meetup 2025

Dual JVM (AOT and JIT) in Enso�

2 of 11

Functional JVM!

Jaroslav Tulach

Enso runtime engine team member. Formerly GraalVM, Oracle Labs. Even formerly NetBeans Platform architect and NetBeans Founder.

Engine Team

  • Functional Programming addict in 90-ties

Concurrent Clean. “Typing in Terms of Graphs” thesis.

​

  • Java IDEs & Tooling�Java more real than FP. Wrote Xelfi. Founded and architected NetBeans and its APIs.

​

  • OracleLabs & GraalVM�Sick of IDEs. Truffle. Compilers. Tooling. Insight. Polyglot.

​

  • Enso & GraalVM & Tooling�Back to the functional programming! Back to IDEs! On top of GraalVM!

3 of 11

Enso - the Strict Functional Language

  • Dual representation

Visual and Textual. Smooth switching between both.

​

  • Live programming environment�Coding by playing!

​

  • Fast Startup with Native Image�But the executable is huge! All stdlibs compiled in

​

  • Ecosystem of Libraries�–jvm flag for 3rd party libraries - all or nothing!

​

4 of 11

Demo Enso IDE & Language

5 of 11

Intermezzo: DukeScript

​

  • Mixing Java and JavaScript since 2012 �”Native” method call into JavaScript

​

  • Bridging two virtual machines�In process or over network, synchronous or asynchronous

​

  • Two garbage collectors�Unless unified by transpiling or Graal.js�
  • Bridging JVMs can’t be that different!?�In process, synchronous, two GCs�

​

6 of 11

Launching Dual JVM

​

  • Start in Native Image Mode �Interpreter, networking & actors via Akka, etc.

​

  • Load JVM via JNI_CreateJavaVM�Handles the –jvm switch by JVM.create(...).executeMain(...)

​

  • Launch and forget ”solution”�Either fully in native image or fully in HotSpot JVM�
  • Written in System Java�Works on Linux, Macs, Windows (except #12384).�

​

7 of 11

Communication via Channel

​

  • Have a JVM? Create a Channel!�Provide config class. Loadable in both JVMs!

​

  • Channel created in both JVMs!�master in SubstrateVM and slave in HotSpotVM

​

  • Define extensible set of messages�Typically a record that implements Function�
  • Channel.execute(msg) to serde, eval and serde back�Good old synchronous messaging system.�

​

8 of 11

RMI like via Channel

​

  • Have a Channel? Use Truffle to build interop!�Basic messages: LoadClass. Invoke a method. Distributed GC.

​

  • Define the same interface in both JVMs!�Smooth but with transport overhead

​

  • Exchange direct buffers between both JVMs �Chunk of memory outside of heap. In the same process.�
  • Channel.execute(msg) to serde, eval and serde back�Good old synchronous messaging system.�

​

9 of 11

Demo Dual JVM

10 of 11

Pros/Cons of Dual JVM Mode

​

  • Regression in GraaVM25 on Windows!�Include Dual JVM tests in GraalVM itself?

​

  • Two heaps and two GCs�Separate data. Shared code. Shared off heap memory.

​

  • Boundary with messages�Micro benchmarks, not End-to-end benchmarks. Shared memory to the rescue.�
  • HotSpot JVM is running 100% compatibly & 100% fast�Can the “other” HotSpot JVM be compiled by SVM too!?

​

​

11 of 11

Enso. No-code interactive �data processing and automation tool.