A system for getting static type information.
This effectively gives (some) of the power of reflection without any of the runtime cost!
The original use case was type-checking generated code in a JIT compiler (with zero runtime cost). However, other use cases are certainly possible :)
Contributions are welcome! I’d be happy to add more features as long as they align with the general philosophy of compile-time reflection.
Types builtin to the ‘static reflection’ system
Reflection information on function declarations
The static type system
Define a type’s implementation of StaticReflect as an extern type
Get the integer offset of the specified field
A type that supports accessing its fields via reflection.
The trait for types whose information can be accessed via static reflection.