These are chat archives for rust-lang/rust

4th
Dec 2016
Matanel Levi
@matanelevi
Dec 04 2016 09:58
@dhylands it's a bit ambiguous :D
Thanks anyway!
Pavel Meledin
@btbvoy
Dec 04 2016 12:14
What would one use for encoding / decoding to / from JSON in rust? serde? or there are other options?
Sergey Noskov
@Albibek
Dec 04 2016 12:18
there is also rustc-serialize and https://github.com/maciejhirsz/json-rust
Pavel Meledin
@btbvoy
Dec 04 2016 12:21
as far as I get it's kind of not anymore in development. and serde is the subject to became a generic serializer for rust ecosystem. is that correct assumption?
Pavel Meledin
@btbvoy
Dec 04 2016 12:28
@Albibek my previous message was about rust-serialize crate but I'll check json-rust you've mentioned above, thanks
Jarred Nicholls
@jnicholls
Dec 04 2016 13:44
@btbvoy serde is the way to go!
Pavel Meledin
@btbvoy
Dec 04 2016 18:31
@jnicholls thanks but still I found it not comfortable to use for stable version of compiler
Jarred Nicholls
@jnicholls
Dec 04 2016 18:44
@btbvoy it's quite fine for stable compiler, I recommend putting structures that are attributes with Serialize/Deserialize in a separate file and write a build.rs script that compiles it through serde codegen and outputs to a module that you are including in your crate.
It's an extra step but once it's in place it's elegant and done with.
Sergey Noskov
@Albibek
Dec 04 2016 18:49
and you only need to do this until macros 1.1 came in stable, that is pretty soon
Jarred Nicholls
@jnicholls
Dec 04 2016 18:49
True true
Pavel Meledin
@btbvoy
Dec 04 2016 18:51
there is a problem. I have some data types which I’m using inside of my application, let’s say it’s ProductId which I use internally and externally. So using serde I’ll have to have dedicated copy of it for serde purposes as external interface and then just copy into internal structure. In general it’s correct to have separated exposed API in internal structs but in this case ProductId doesn’t look as which will be very different in internal & external structure
Pavel Meledin
@btbvoy
Dec 04 2016 19:02
@Albibek @jnicholls btw, is there any source where I can find some dates it to be finally released ? Since so far I only found that there is a progress on macros 1.1
?
around 90%
but no any dates when it’s going to be released