Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upNeeds serde example #50
Comments
|
Sadly, serde is at a point where a "hello world" serde serialization would be hundreds of lines of boilerplate unless you were to use the nightly version of the compiler with the serde plugin added. I'm highly against using examples that only build on nightly versions of the compiler because I don't want bincode to be seen as something that should only be used on nightly versions, so it'll be a messy example. I'll see if I can get around to this later this week, but honestly, if I were you, I'd use rustc_serialize until rust gets stable compiler plugins. Writing serde serializers/deserializers is hard, and the way that bincode works makes it basically impossible to debug when they go wrong. The only person I would trust to write a serialize/deserialize pair is my compiler. |
Thanks! The vocal users on users.rust-lang.org say that rustc_serialize is inferior... this is a great reality check for me. I'll stay with rustc_serialize. |
From a technical standpoint this is true. Rustc_serialize is also not going to get any more improvements going forward, so Serde is the end-game. But right now it's pretty hard to use without the nightly-only plugin. |
As a new rustacean, I've read elsewhere that Serde is preferred over rustc_serialize. Would you please add a full example of using bincode with serde?