-
Notifications
You must be signed in to change notification settings - Fork 7.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adopt go 1.18 Generics #36308
Comments
Blog (https://go.dev/blog/12years):
|
Proposal: Allow generics in test only code, with production code still not using generics until at least 1.19. Rationale:
Thoughts? @istio/wg-test-and-release-maintainers |
I got pretty great reduction in duplicate code using generics in actual code in fortio I left the pre existing tests alone for now actually because I wanted to test that the generic version worked exactly the same Curious why intend just the tests for now? concern about performance in main code? or that it'll improve/change in 1.19 enough to cause churn? |
I wouldn't probably introduce generics in performance critical paths unless we really test performance or just wait for a few more releases of golang. This article uncovers a lot of pains with current implementation of genetics in galang. https://planetscale.com/blog/generics-can-make-your-go-code-slower |
I agree with the slow adoption, test now, starting some in production with 1.19. I'm not sure if there is some verbiage to add with respect to performance critical paths, but I think the community understands the underlying issues with not impacting performance. |
It may be a bit conservative, but mostly for hypothetical performance issues, churn is a big one as well. There are also all the unknown-unknowns. Tests only gives us a good way to dip our toes in and see how it goes. 1.19 is only like a month away anyways |
For 1.15 allowing it in test code is fine. For 1.16 we could start allowing it in. That way if anyone wishes to start working on a change they could have it ready by shortly after the branch cut off happens in mid-August. It's also fine to say that it's ok for changes in the control plane, but are limited to certain packages for the time being (inclusive or exclusive is fine with me). |
+1 Honestly, I'm not even sure why this would be up for debate. Just do it, since it's only test code. Obviously any decision for production code would need to be scrutiny. |
This enables istio#36308 (comment)
Istio T&R has made an intentional decision to not merge any PRs adding generics until at least 3 months after Go 1.18's release, to reduce churn and instability. Everything discussed below is future looking, after this date has passed.
Issues:
TODO
Areas of interest:
The text was updated successfully, but these errors were encountered: