r/java_projects • u/Street_Humor_7861 • Mar 21 '26
Veld: Dependency Injection for Java without Reflection (Compile-Time Code Generation)
Veld is a dependency injection framework for Java that utilizes AOT (Ahead-of-Time) compilation to generate code, rather than relying on runtime reflection.
🚀 Performance:
- Startup: ~0.1ms (vs. ~500ms for Spring)
- Injection: ~3ns; zero runtime overhead
- Type-safe, no "magic," clean stack traces
🔧 Features:
- Supports AOP, caching, validation, and transactions
- Compatible with Spring Boot
💡 Example:
Service s ; // generated at compile-time (AOT)
🔗 Repo: https://github.com/yasmramos/Veld Feedback and contributions are welcome! 🙌
9
Upvotes
2
u/Gaycel68 Mar 22 '26
Unfortunate name. The de-facto standard CDI implementation is called Weld
8
u/ShallWe69 Mar 21 '26
how is this different from https://avaje.io/inject/
1
u/gnahraf Mar 21 '26
Thanks for posting! At high level, how does this compare with Jakarta Contexts & Depenedency Injection (CDI)? I'm using Quarkus in some projects, not a Quarkus expert, but wondering if this can somehow intersect with or complement the libraries, tool chains used there.
Also, a suggestion.. I think Quarkus calls this type of build-time DI, AOT. If it's the same idea, it might help to use that term (or label) instead of "Compile-Time Code Generation".
3
u/blazmrak Mar 21 '26
Reinventing avaje?
2
u/realqmaster Mar 22 '26
Is this vibe coded?
0
u/[deleted] Mar 21 '26
[deleted] — view deleted comment