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

RFC: Deserializing to a stream of tagged values #22

Closed
wants to merge 2 commits into from

Conversation

erickt
Copy link

@erickt erickt commented Mar 27, 2014

This is an RFC to convert Rust's deserialization framework to produce a stream of tagged values.

@erickt
Copy link
Author

erickt commented Mar 28, 2014

@kud1ing: Fixed, thanks.

@erickt
Copy link
Author

erickt commented Mar 28, 2014

For reference, I have an experimental repository that implements many of these ideas: https://github.com/erickt/rust-serde. I made it a couple months ago, so it does not run against rust HEAD at the moment.

@erickt
Copy link
Author

erickt commented May 12, 2014

I've updated https://github.com/erickt/rust-serde to with with Rust HEAD, assuming rust-lang/rust#14120 lands.

@BurntSushi: you expressed interest in playing around with it. I still have some modernization to do on it though.

@nikomatsakis
Copy link
Contributor

@erickt some scattered thoughts:

  1. I am confused by the premise of this RFC. We currently include the ability to handle enums, which basically amounts to serializing an integer and then doing a match inside the decoder?
  2. In general, I like the approach, but I'd be happier if the stream of tagged values were somehow more primitive. For example, just ints/uints/chars and "tags", and maybe we define some standard tags for grouping. I'm wary of decoders that require lookahead though.
  3. Performance is pretty important. I'd like to convert rustc to use the standard encoders/decoders but my last effort (admittedly some time ago) led to a rather large drop in compile-times, so I never landed it.
  4. Have you compared with other existing efforts to make standard serializers and deserializers? I'm not sure what we can learn from there, if anything.
  5. As a meta-thought, I do think the encodable/decodable need work but -- when I last investigated -- I found some other type system problems holding up proper resolution. Unfortunately I haven't made much progress in resolving those, I'll give it a shot.

@mhristache
Copy link

Is this suppose to offer a solution for rust-lang/rust#12794?

@erickt
Copy link
Author

erickt commented Sep 1, 2014

@TheMax: yes this will be able to handle #12794. I've already implemented support for it in https://github.com/erickt/rust-serde.

@aturon
Copy link
Member

aturon commented Mar 2, 2015

I'm going to close this RFC for now, since these ideas are embodied in @erickt's serde library. While this may eventually become part of std, for now it lives out of tree.

@aturon aturon closed this Mar 2, 2015
withoutboats pushed a commit to withoutboats/rfcs that referenced this pull request Jan 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants