I have been looking at Rust for a while, and I really like the idea of a strict and a rich type system and save memory allocation (no more mark sweep ). I have been using C++ for many years, so Rust is a refreshing approach.
But what I can’t find a way in Rust to make dynamic mapping of values like mapping things from a JSON structure to a Rust type, or how to pack arguments from dynamic values and then call a function using this values. (as it now is possible to do using C++ templates).
In languages like Go, this can be done using reflection, and they have a very nice JSON mapping, where the type info (and meta hints) in Go can be used to validate dynamic values.
I have seen some writing about reflection in Rust, but it seems like this is not a part of the language that have matured, and it have no standard library to support this.
So … how can I make a JSON object to a Rust type, and how can I find a function by its name, and pack dynamic values to a function call ? I could, of cause, make some IDL compiler but I like the idea of using the type system in the language and not maintain to definitions.