I've been building scaling Go backend services and got increasingly frustrated with the current Dependency Injection ecosystem. I love the pure compile-time safety of tools like Google Wire, but manually maintaining massive ProviderSets becomes a tedious chore. On the other hand, convenient runtime tools (like Uber Fx) rely heavily on reflection, which sacrifices strict compile-time safety and risks runtime panics (One of the reasons that forced me to leave Java).
To solve this, I built Flora (v1.0.0).
It acts as an AST parser. You simply tag your structs or config functions, and Flora auto-discovers the dependency graph. Under the hood, it generates a strongly-typed, reflection-free DI container using Google Wire.
The result: 0% runtime overhead, 100% compile-time safety.
A big priority for me was supporting Clean Architecture / DDD. I didn't want framework structs polluting my core domain logic, so Flora natively resolves go/types aliases (e.g., type DIComponent = flora.Component). This keeps the domain completely free of external framework imports.
soner3•2h ago
I've been building scaling Go backend services and got increasingly frustrated with the current Dependency Injection ecosystem. I love the pure compile-time safety of tools like Google Wire, but manually maintaining massive ProviderSets becomes a tedious chore. On the other hand, convenient runtime tools (like Uber Fx) rely heavily on reflection, which sacrifices strict compile-time safety and risks runtime panics (One of the reasons that forced me to leave Java).
To solve this, I built Flora (v1.0.0).
It acts as an AST parser. You simply tag your structs or config functions, and Flora auto-discovers the dependency graph. Under the hood, it generates a strongly-typed, reflection-free DI container using Google Wire. The result: 0% runtime overhead, 100% compile-time safety.
A big priority for me was supporting Clean Architecture / DDD. I didn't want framework structs polluting my core domain logic, so Flora natively resolves go/types aliases (e.g., type DIComponent = flora.Component). This keeps the domain completely free of external framework imports.
I also wrote a deep dive on the architecture and the "Zero Boilerplate / Zero Reflection" concept here: https://medium.com/@astansoner/a-dependency-injection-tool-f...
I would love to hear your brutally honest feedback on this AST-driven approach! Happy to answer any questions about the implementation.