Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Needs serde example #50

Closed
rw opened this issue Dec 8, 2015 · 3 comments
Closed

Needs serde example #50

rw opened this issue Dec 8, 2015 · 3 comments
Labels

Comments

@rw
Copy link

@rw rw commented Dec 8, 2015

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?

@TyOverby TyOverby added the enhancement label Dec 8, 2015
@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Dec 8, 2015

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.

@rw
Copy link
Author

@rw rw commented Dec 9, 2015

if I were you, I'd use rustc_serialize until rust gets stable compiler plugins

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.

@rw rw closed this Dec 9, 2015
@TyOverby
Copy link
Collaborator

@TyOverby TyOverby commented Dec 9, 2015

vocal users on users.rust-lang.org say that rustc_serialize is inferior

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.