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 & ToolingJava more real than FP. Wrote Xelfi. Founded and architected NetBeans and its APIs.

  • OracleLabs & GraalVMSick of IDEs. Truffle. Compilers. Tooling. Insight. Polyglot.

  • Enso & GraalVM & ToolingBack 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 environmentCoding by playing!

  • Fast Startup with Native ImageBut 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 machinesIn process or over network, synchronous or asynchronous

  • Two garbage collectorsUnless 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_CreateJavaVMHandles the –jvm switch by JVM.create(...).executeMain(...)

  • Launch and forget ”solution”Either fully in native image or fully in HotSpot JVM
  • Written in System JavaWorks 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 messagesTypically a record that implements Function
  • Channel.execute(msg) to serde, eval and serde backGood 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 backGood 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 GCsSeparate data. Shared code. Shared off heap memory.

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

11 of 11

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