Description
Checklist
- I have searched the issue tracker for open issues that relate to the same feature, before opening a new one.
- This issue only relates to a single feature. I will open new issues for any other features.
Is your feature request related to a problem?
We do currently have a couple untyped bindings that rely on runtime reflection to look up types and set their values appropriately. This reflection is slow, does not give the developer any type safety (which may lead to crashes or potential security issues popping up) and it might lead to larger binaries as the Go compiler needs to embed more type information that can be used at runtime. We should avoid runtime reflection to as large extent as we can.
It has been proven with #5378 that generics are a great fit for reducing code duplication within binding types. A generic implementation for bindings should be possible to use for this purpose.
Is it possible to construct a solution with the existing API?
Yes
Describe the solution you'd like to see.
I propose that we expose a generic binding that lets the compiler generate a type safe binding implementation for the specific type that the developer wants to use instead.