Code Reflection
summary
Proposes adding code models to Java Reflection so libraries can access, analyze, and transform method and lambda bodies (compile-time or runtime), serialize those models into class files, and lower them to SSA or bytecode; demonstrates a working OpenJDK prototype used by PGX for parallel graph compilation and shows automatic-differentiation flow that returns method handles after transforming a method; design borrows MLIR ideas, supports quotable lambdas, and aims for an immutable, traversable API—prototype exists and reports successful experiments.
AI-written summary · about
chapters (10)
- 0:00Intro
- 0:26Motivation
- 1:22What Developers Do Today
- 5:41Transformation
- 6:32Program Access
- 8:51Code Reflection
- 14:49Code Models
- 29:37SSA Transform API
- 31:18SSA Transformation
- 35:13Future Plans
related talks
53mProject Babylon - Code Reflection
42mEternal Sunshine of the Spotless Macro
01h 10mReflection Is Good for C++ Code Health
25mSymbolic Modeling and Transformation of Java Code
45mMaking Java more dynamic
39mYour Program as a Transpiler
50mRevealing the magic behind Java annotations
44mIt’s Java, but Not As We Know It
