Earlier quoted context omitted.
Why? It's much more verbose and error prone (e.g. "stringly typed"). Do you never deserialize JSON?
What's the difference between mistyping in the string here and mistyping in the struct definition? And yes I have.
A Rust API Inspired by Python, Powered by Serde
21–27 of 27 posts
Re: A Rust API Inspired by Python, Powered by Serde
#22Earlier quoted context omitted.
I wrote typedload in python. Once they show you an API with hundreds of types you appreciate not having to do like that all the time.
I don't see the issue with just using an equivalent to `impl Deserializer for ValueDeserializer` then.
Re: A Rust API Inspired by Python, Powered by Serde
#23Earlier quoted context omitted.
I don't see the issue with just using an equivalent to `impl Deserializer for ValueDeserializer` then.
There's unions, there's stuff that uses reserved words in the language as field names... You are obviously not familiar with this task.
My point is I don't want to do "this task" at all if "this task" means layering funky auto-generated machinery on top of what is already a perfectly reasonable API.
Re: A Rust API Inspired by Python, Powered by Serde
#24Interesting post. We wrote this “below” utility [1] that monitor system metrics similar to atop. We want the ability to collect all metrics into a single object, pass it around and visualize it elsewhere. Naturally we need some way to query into fields or even nested-struct fields. For example, to get the file cache usage of a particular process, we need to go through sample->processes->pid->memory->file cache. To do…
Re: A Rust API Inspired by Python, Powered by Serde
#25(Author here) I needed to do a bit of "reflection" in a Rust crate but didn't want to implement a procedural macro, so I used Serde (which is a (de)serialization crate) instead. This is also a deep dive into Serde internals - hope you'll like it!
Re: A Rust API Inspired by Python, Powered by Serde
#26Re: A Rust API Inspired by Python, Powered by Serde
#27The title is vague in my opinion. What kind of API? What problem does it hope to solve? The article uses querying system data as examples, but after skimming it, I’m not sure why I would care. My comment is also a criticism of the article, since I couldn’t skim in quickly to figure out if I should spend more time on it.
(Author here) Thanks! That's useful feedback. I also agree - the final article isn't skim-friendly enough, which drives away some readers.