Customizable synthetization #724
kyouko-taiga
started this conversation in
Language design
Replies: 0 comments 1 reply
-
It's worth looking at this pitch, which accomplishes the same goal. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have an idea for a feature but no syntax for it.
Because metatypes will enable some level of reflective programming, it should be possible to use them to express how a trait conformance can be synthesized using the runtime API, rather than hardcoding synthesizers for pre-defined traits in the compiler.
The challenge is that, for an arbitrary type, there's no way to use the type system to guarantee that all parts of a type satisfy a desired property (e.g., to synthesize
Equatable
for lambda types). So we would probably need a way to programmatically test if a type satisfies these properties.It seems reasonable to imagine that such a test could be executed as a compile-time function.
Beta Was this translation helpful? Give feedback.
All reactions