-
Notifications
You must be signed in to change notification settings - Fork 66
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
Reflect: generic type identification #83
base: main
Are you sure you want to change the base?
Reflect: generic type identification #83
Conversation
reflect_generic_id
rfc
I don't think this will solve the problem. Even if you manage to get some |
These requirements would probably be part of the trait implementation requirements. Apologies if this comes off a bit chaotic. I might have only a set of specific applications in mind and also maybe some misunderstandings about the current reflect implementation and uses/connections. |
|
You likely don't want to hash
This cannot be done automatically on-the-fly when a It might work if you perform this conversion the moment you create some type, essentially canonicalizing that type, but then you're just performing deserialization using reflection and type paths should be enough for that.
My point is that for many usecases this cannot be just a possibility, it has to be a guarantee or you have unsoundness. |
|
||
> Why should we *not* do this? | ||
|
||
This introduces a concept of multiple type identifications which might have no connection between them. There would be no singular central type registry, but instead a number of registries, each with a different id type and for a different purpose. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is probably one of the biggest issues with this approach. If we end up going with a generic type identification system, we need a way to interop between them such that we can have a central registry.
If we don't have that, then the onus to use the correct registry/identification falls on the user.
Personally, I'd like to know more about how we intend to support cross-binary types. Are we passing around raw pointers, utilizing the dynamic types, allowing specially-made custom dynamic types, serializing-deserializing, or something else? Depending on how this is done, "downcasting"1 should be possible through type data. In any case, it would be good to identify these particular methods so we can properly assess whether a generic identification system truly covers those cases, or if another solution needs to be explored. Footnotes
|
Rendered: https://github.com/JohnTheCoolingFan/bevy-rfcs/blob/reflect_generic_id/rfcs/83-reflect_generic_id.md
Make type identification in the Reflection system generic, allowing multiple identification data types to coexist.