-
Notifications
You must be signed in to change notification settings - Fork 195
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
[should gengo add] Support for 1.18 Generics #225
Comments
I think the question we need to answer first is if gengo is still needed at all post-generics. |
That's an interesting question. I guess I don't fully understand the responsibilities of gengo, but naively would think it loosely breaks down into: parsing comment markers to make up for lack of annotations (and more generally, comments on fields/types) & generating functions for given types. If we were able to write generic functions for deepcopy, conversion, defaulting, we'd still need something to parse comment markers, no? |
I mean, if we had C++ template power, we could definitely get rid of gengo and just use various template magics to put in doc strings, add attributes etc. I think what we got in go 1.18 isn't powerful enough for that, but I haven't thought about it super hard yet? |
Yeah, agreed — not sure the go 1.18 type parameters are enough, though maybe there's some creative thinking to be done. In any case, being able to leverage them in API types (and elsewhere) may get us closer to removing a lot of nasty reflection business in kube-apiserver. |
The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale |
Any thoughts come up in the last few months @lavalamp? Should we just close this? |
Nope haven't had time to consider this much at all, I think we should leave the issue open, I'd like more voices to weigh in. |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues and PRs according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten |
The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs. This bot triages issues according to the following rules:
You can:
Please send feedback to sig-contributor-experience at kubernetes/community. /close not-planned |
@k8s-triage-robot: Closing this issue, marking it as "Not Planned". In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
When experimenting with using go 1.18 generics in some k8s type definitions, I'm hitting errors (as one would expect with such a large language change). I'm running conversion, defaulter, and deepcopy generation on the following types.
The errors seem to start with the gengo parser not having a case for the generic type param:
gengo/parser/parse.go
Lines 857 to 865 in 4627b89
I'm wondering if anyone would take a guess on how complex this would be to add support for? From brief experiments, it seems the answer may be "very hard" 😬 .
The text was updated successfully, but these errors were encountered: