Your Program as a Transpiler
summary
Runtime reflection and classpath scanning turn a simple DI demo from ~3 seconds startup into a generated binder that runs in 87 ms on the JVM and 3 ms as a native-image built with GraalVM SubstrateVM. The heavy reflections scan is moved to an annotation processor that emits Java using JavaPoet (or bytecode via ASM), plugged into Maven, so parsing/validation work happens at build time. Drools and jBPM use the same approach in the Submarine initiative to precompile DSLs and shave boot time.
AI-written summary · about
chapters (25)
- 0:00Intro
- 2:54Boot-time vs. Run-time
- 3:34Example: A Quick DI Framework
- 5:45Example: Boot Time
- 10:29Transpilers vs. Compilers
- 11:32Are transpilers simpler than compilers?
- 13:39The distinction is moot
- 14:28Compiler-like workflows
- 15:29What's a compilation phase?
- 15:55Configuring the application
- 16:20Application wiring
- 18:26Compiling a programming language
- 19:04Recognize your compiler passes
- 19:37What makes a compiler a proper compiler
- 21:45Example. A Configuration File
- 22:01Example. An ORM Library
- 22:31Example. A DI Framework
- 24:20Compilation Phases
- 26:34Use proper code generation tooling
- 27:13Write a build plug-in
- 27:58DI: Annotation Processor
- 29:45The Submarine Initiative
- 33:34Startup Time
- 34:14Take Aways
- 35:01Resources
related talks
50mRevealing the magic behind Java annotations
40mYour Program as a Transpiler: Applying Compiler Design to Everyday Programming
46mJava annotation processing magic for muggles
43mHow and why I turned my old Java project into a first-class serverless component
46mBring the Action: Using GraalVM in Production
23mAdopting GraalVM
48mRevolutionizing Java-based Applications with GraalVM.
52mGraalVM: Run Programs Faster Anywhere
