OpenJDK Project Loom: Fibers, continuations and **tail-call elimination** are coming to the JVM

I’ve not dug very deep in project Loom yet, but here’s my thoughts from what I’ve read.
This talk is relevant as well : https://www.infoq.com/presentations/continuations-java/

  • Continuations

I like the design decision of exposing the low-level construct. It’s a sound choice leaving room for a wide range of possibilities and that makes me really confident about the future of the JVM.

I think it will be more disruptive for java ecosystem than for clojure, since clojure can already solve problems of this kind with syntax manipulation. Project loom’s continuations are strictly more powerful as they’re not restricted to a single stack frame, but I’m still not sure how much of a game changer it is.

One other benefit I see is better debugging and monitoring. The main downside of syntax manipulation techniques is the mess of stacktraces it makes, and that could be a good reason to rely on host platform capabilities instead. This has already been discussed for clojurescript : Async/Generator functions in CLJS - (requesting feedback!)

  • Fibers

I remain dubious about structured concurrency. I still see it as an imperative solution to an imperative problem, in addition of being quite complicated. I just see more possibilities in the functional path.

  • Tail calls

That sounds like an orthogonal problem to me, I don’t quite understand why it’s part of the project.

2 Likes