Jactl scripting language mimics Virtual Threads on pre-Loom Java
The creator of Jactl, an embeddable scripting language for Java, explains how it was built to avoid blocking event-loop threads even though it targeted Java 8 and 11, long before Virtual Threads and Project Loom existed. Jactl uses an internal async mechanism that suspends a script's execution during blocking operations like database calls, freeing the underlying thread, and later resumes the script once the result is ready.
GoKawiil's interpretation of the reporting above, not reported fact.
This approach shows how developers solved the thread-blocking problem inherent to reactive, event-driven architectures years before Java's native Virtual Threads made such concurrency easier. It also highlights the flexibility of Jactl's design, since applications on newer Java versions can now simply disable this custom async system via JactlContext.async(false) and rely on Virtual Threads instead.
- Jactl was designed to run scripts on event-loop threads without blocking them, using a custom async suspend-and-resume mechanism.
- This solution predates Java's Virtual Threads and was necessary for compatibility with Java 8 and 11.
- Newer Java applications using Virtual Threads can disable Jactl's built-in async behavior via a configuration flag.
Java Concurrency in Practice by Brian Goetz — If continuations, event loops and non-blocking execution in the JVM fascinate you, this is the classic reference that explains the threading model underneath it all. It's the perfect companion for anyone reasoning about async scripting engines, virtual threads, and reactive Java architectures.
See Java Concurrency in Practice by Brian Goetz on Amazon → Affiliate link — we may earn a commission on purchases, at no extra cost to you. Product picked by AI based on this article; it is not a tested recommendation.Source: jactl.io — James Crawford, 2026-09-01
Published there as: “Virtual Threads for a scripting language in Java 8 without Loom”
Read the original report → The summary and analysis above are GoKawiil's own, written from reporting by the source above. Facts and quotes belong to the original publisher.