3 ms·
> Serde is a fantastic part of the Rust ecosystem, and is often credited as a reason people reach for Rust. From what little I've seen of it, from a user persp
by VyseofArcadia 2y ago
> Serde is a fantastic part of the Rust ecosystem, and is often credited as a reason people reach for Rust.
From what little I've seen of it, from a user perspective it seems like a pretty bog standard (de)serialization library. What is so special about it that people would reach for Rust to use it instead of an equivalent library in their language of choice?
- steveklabnik 2y agoThere isn’t anything super novel about Serde, for sure. But there’s three important things about it, in my mind: 1. It is extremely convenient and pleasant to use. 2. It’s kind of like pandoc: due to its design, it’s not just a serialization library for a specific format, but instead a platform for other libraries. Want to take in some JSON and produce TOML? No issues. Those two libraries are already interoperable. See 1 again. 3. Due to being an extremely old library, as well as a good one, everyone supports it where appropriate. This ubiquity, combined with the flexibility of 2, is a big part of what makes 1 true as well. This doesn’t mean that Serde isn’t perfect, mind you. But it is very good. And with Rust’s reputation as a difficult language, I think sometimes are surprised when things are actually convenient.
- josephg 2y agoI think the point here is that C++ notably doesn't have an equivalent to serde. Its very hard to make an equivalent library in C or C++ without some external codegen step, manually writing parsing code, or some horrible macros. Mind you, it sounds like this will change with C++26. Good times!