Project Babylon: Extending Java to GPUs and Advanced Programming Models
Project Babylon, unveiled through an OpenJDK proposal by Paul Sandoz of Oracle, represents a significant evolution in Java’s versatility by extending its compatibility to encompass a range of foreign programming models.
This ambitious initiative targets integration with diverse paradigms such as machine learning models, GPUs for accelerated computing, SQL for relational database interactions, and differential programming for advanced mathematical computations.
At its core, Babylon proposes to enhance Java’s reflective programming capabilities, particularly through code reflection, enabling standardized access, analysis, and transformation of Java code to meet the requirements of these external models.
By harnessing Java libraries, the project aims to establish a flexible framework that facilitates seamless integration of foreign programming paradigms into the Java ecosystem. This approach not only streamlines the development and deployment of complex applications but also enhances Java’s relevance in modern computing landscapes where diverse computational models are increasingly essential.
Elaborating on what Babylon would address, Sandoz cited an example in which a developer wants to write a GPU kernel in Java and execute it on a GPU. The developer’s code must be analyzed and transformed into an executable GPU kernel.
While a Java library could do that, it requires access to the Java code in symbolic form. Such access currently is limited to the use of non-standard APIs or to conventions at different points in the program’s life cycle, i.e. compile time or run time. Further, the symbolic forms available (abstract syntax trees or bytecodes) often are ill-suited to analysis and transformation.
Plans call for Babylon to be delivered over time, in a series of JDK Enhancement Proposals (JEP) likely to span multiple feature releases. Code reflection would start with a clone of the mainline release of JDK 22, which is due in March 2024, and track mainline releases moving forward.
For the GPU programming model, the project would create a separate repository dependent on code reflection features as they are developed. There currently is no plan to deliver the GPU programming model into the JDK, but work on that model could identify JDK features and enhancements of general utility that could be addressed in the future.