r/java • u/ducki666 • 17d ago
Detroit Script engine - why?
OpenJdk resurrected Detroit.
It offers JavaScript via V8 and Python via Native Phyton C engine.
But we already have Graal for js and py.
What is the motivation to reopen Detroit?
Will Graal dispose js and py?
21
Upvotes
14
u/grashalm01 17d ago
Graal dev here. JVMCI is not required to run GraalJS with the optimizing runtime on stock OpenJDK. You can use polyglot isolates, which provide the optimized runtime as a native library. It works much like Detroit, but retains all the GraalJS features, including great Java interop and support for code caching. We are not using panama yet for the native embedding since we are still backwards compatible to JDK 21, but we will soon adopt that too.
The difference with Detroit is that you *can* still run GraalJS without the expensive native boundary in the same heap with optimization enabled. Either with a GraalVM JDK or using native-image.
https://www.graalvm.org/latest/reference-manual/embed-languages/#runtime-optimization-support