3 ms·
I'm glad serde exists but I don't like HOW it works: I think there should be a push for rust-lang to provide introspection. If you want to use serde, every cra
by cztomsik 5y ago
I'm glad serde exists but I don't like HOW it works:
I think there should be a push for rust-lang to provide introspection. If you want to use serde, every crate needs to derive serde traits as well. This is not only bad architecture but it also prevents other libraries to get popular. For example, there are many "mini-serde" variants and I personally think, they are awesome (and surprisingly fast), yet you cannot practically use them because literally no crate supports anything else than serde.
https://github.com/dtolnay/miniserde https://github.com/dtolnay/miniserde
https://github.com/not-fl3/nanoserde https://github.com/not-fl3/nanoserde
https://github.com/makepad/makepad/tree/master/render/microserde https://github.com/makepad/makepad/tree/master/render/micros...
- jcelerier 5y agoI wonder if the c++ approach of boost.pfr would be portable to rust ? It allows reflection on aggregates without needing to annotate anything: https://github.com/boostorg/pfr https://github.com/boostorg/pfr
- cztomsik 5y agoI think currently, the only closest thing is bevy-reflect. Which is nice, but IMHO it should be in the language because nobody supports it ATM and to get there, it will take at least the same time it took for serde to get supported. https://crates.io/crates/bevy_reflect https://crates.io/crates/bevy_reflect