Now that Monkey has a module to support Reflection, would it be technically feasible (and relatively straightforward) to write a serializer leveraging it?
Mainly, I am thinking of a way to inspect and tokenize various JSON types into monkey equivalents (or even generic containers), and stuff them into a class based on matching tag identifiers. However, I haven't tested out the reflection module yet, and don't know if it breaks or changes any of Monkey's default behavior by including it in a project, or if the functionality even extends far enough to accomplish a general deserializer.
Right now I'm using Warpy's JSON class to get objects I serialized from .net's JsonDataContractSerializer into Monkey, but that requires a lot of manual finagling (and casts upon casts upon casts!). Warpy said a while back that having Reflection would solve a lot of these problems, but in the interim since Reflection was added to the language, I haven't seen anyone (not even the diddy guys, afaik) attempt to write one.
What would such an undertaking involve, and are there any potential pitfalls and gotchas to implementing it in Monkey at its current state?
|