Compile time or runtime? Compile time reflection would be completely painless and bloat-free.
replies(3):
I suppose C++'s template system might be able to generate JSON deserializers with static reflection as well
Swift got into this mess early in it's lifecycle and it's type checking is still more expensive than the rest of the compiler combined, and unpredictable on top of that.
template<typename T>
T my_construct() { T result; return result; }