Decrusting the serde crate

Ғылым және технология

In this stream, we peel back the crust on the serde crate - github.com/serde-rs/serde/ - and explore its interface, structure, and mechanisms. We talk about Serialize/Deserialize, Serializer/Deserializer, and the Visitor trait. We also get into the serde data model, and in particular the separation between data types, serde data values, and data formats.
For more details about serde, see serde.rs/.
I use `cargo expand` extensively in this video, which you can find here: github.com/dtolnay/cargo-expand
The streaming calendar is at calendar.google.com/calendar/..., with some other formats listed in / 1602067723986513920 .
0:00:00 Introduction to "decrusted"
0:01:51 Regular streaming schedule
0:02:43 serde
0:04:28 The serde data model
0:14:51 Exploring serde's derived impls
0:17:05 Derived impl Serialize
0:27:56 Derived impl Deserialize
0:53:55 serde derive attributes
1:02:50 (De)serializing enum variants
1:07:31 Enum variant representations
1:24:32 Variant attributes
1:25:54 serde(borrow)
1:38:43 Writing data formats
1:49:48 Closing thoughts
Live version with chat: • Decrusting the serde c...

Пікірлер: 51

  • @ASJ-95
    @ASJ-95 Жыл бұрын

    It's nice that Serde included this video in their homepage.

  • @cat-.-

    @cat-.-

    Жыл бұрын

    honestly having someone to hold your hands and walk you through it feels sooo good.

  • @regexPattern
    @regexPattern Жыл бұрын

    I remember when I first used serde. I just couldn’t believe how incredible it was, and I still can’t.

  • @artem-qm9hz
    @artem-qm9hz Жыл бұрын

    I think this is one of the best programming channels I've ever seen. Not only among rust channels, but all programming channels. Complicated stuff explained simply and in depth at the same time. Thank you, Jon

  • @thomasandolf7365
    @thomasandolf7365 Жыл бұрын

    great stream as always, i feel so humbled over that there are such intelligent people that can write stuff like serde, and for you who can actually read the code and understand what it does. Wish i could get to that level one day.

  • @DavidJamesQ

    @DavidJamesQ

    6 ай бұрын

    I agree -- recognizing the goal and aspiring to writing great abstractions and being humble about it suggests to me like you're already well on your way!

  • @michaelmueller9635
    @michaelmueller9635 Жыл бұрын

    Thx, really high value content. Amazing. There are so many crates out there, so that I'd love to see more than 1 video in 4 weeks. Thx for your work and effort!

  • @MRECoelho
    @MRECoelho Жыл бұрын

    Maybe it is mentioned later in the video (have not finished it yet), but out of curiosity I was wondering why this is not a 'Crust of Rust'. More importantly, I'm grateful for this kind of content. Demystifying code/digging in to the core is always interesting, but guided by an expert makes it more fun and you learn more and quicker. Thank you and cheers!

  • @llblumire

    @llblumire

    Жыл бұрын

    Crust of rust is standard library & core language features. "decrusted" is community created crates

  • @MRECoelho

    @MRECoelho

    Жыл бұрын

    @@llblumire Ah, I see. Thanks for the clarification!

  • @cat-.-

    @cat-.-

    Жыл бұрын

    I thought serde was some sort of standard lol

  • @bramble-east
    @bramble-east Жыл бұрын

    Rust code digging content is rare, this is top notch, can't wait for more Decrusting!

  • @alanhoff89
    @alanhoff89 Жыл бұрын

    Another amazing Rust video to watch!

  • @carlosschellenberger7729
    @carlosschellenberger7729 Жыл бұрын

    Amazing vídeo! Thanks! Turns learning Rust (and Serde) into an exciting adventure !

  • @Ben_Creates
    @Ben_Creates Жыл бұрын

    Wow, Awesome 😍 been waiting for this

  • @origamibulldoser1618
    @origamibulldoser16182 ай бұрын

    Defenestration... One of the best words in the english language.

  • @tomasz-waszczyk
    @tomasz-waszczyk Жыл бұрын

    Thanks for the stream.

  • @ramichasygov1037
    @ramichasygov1037 Жыл бұрын

    Another great stream 👍 Can I ask to make the next video about LLVM? I'm really eager to see your insight on that 🤗

  • @timanderson5717
    @timanderson5717 Жыл бұрын

    This video is on the front page of the serde website.

  • @damoon_az2465
    @damoon_az24652 ай бұрын

    Thanks!

  • @Danielo515
    @Danielo515 Жыл бұрын

    This was very dense, but you made a great job explaining each part. I have been breaking my head trying to write a custom deserializer for my enum format, and there is very little documentation about it,

  • @jwlzloff26
    @jwlzloff269 ай бұрын

    I highly agree to use BLUE as reference to Types!

  • @mahersallam8820
    @mahersallam8820 Жыл бұрын

    Thank you for this fantastic exploration of serde! I noticed that the Github code section/tab you have is different from mine (for example, the directory tree remains on the left side when you open a file and you can search within the file). Is this achieved with a browser extension or is it a setting on Github?

  • @nati7728
    @nati77282 ай бұрын

    Thank you!

  • @monawoka97
    @monawoka972 ай бұрын

    Heya this was really helpful and obviously you have a lot of deep knowledge. FWIW I felt like you breeze over the parts you consider obvious or easy, because they are the common case, and spend more time digging into the nitty gritty weird edge cases that are more complicated. I would actually appreciate if you did the inverse for videos like this. I am most interested in getting solid fundamentals about the common/obvious case since those are where I'll spend the vast majority of my time. And spending so much time on the niche/weird stuff makes it harder for me to remember the basics of how this crate works. EG you never actually write an example of a trivial custom desterilize method here. This made it hard for me to connect the macro generated deserialize to what my custom deserialize might practically look like. Just my 2 cents. Thanks!

  • @jonhoo

    @jonhoo

    2 ай бұрын

    Thanks for the feedback! I tend to focus on the more nitty-gritty bits because the documentation tends to be quite helpful for the simpler cases. Take serde.rs/custom-serialization.html for example, or the code snippets listed under serde.rs/examples.html.

  • @ozanmuyes
    @ozanmuyes Жыл бұрын

    Thanks for the great video! So Serde Data Model is akin to LLVM IR? If so, when serializing, we have 1 front-end (for Rust) and multiple back-ends (one for JSON, one for TOML, etc.). Is that true?

  • @mintx1720
    @mintx17204 ай бұрын

    I wish there can be a serde2 that addresses serde's numerous footguns on its attributes.

  • @zynaxsoft
    @zynaxsoft Жыл бұрын

    Beard

  • @kamu38
    @kamu38 Жыл бұрын

    The part that went into the `from` attribute on the specific fields is exactly what I wanted to do, but it only exists at the container level, not field level. You may have made a mistake here...

  • @ruijieyu9035
    @ruijieyu9035 Жыл бұрын

    57:03 I’m not seeing why you would care about the additional bound: supposedly, derive serialize would insert “where Bar: Radical”, and wouldn’t care in which specific cases is the where clause fulfilled.

  • @jonhoo

    @jonhoo

    Жыл бұрын

    The issue is if the derived code will only typecheck for subsets of the type where the bound holds.

  • @VixieTSQ
    @VixieTSQ Жыл бұрын

    YOU SHAVED AAAAHHHH

  • @secondengineer9814
    @secondengineer98149 ай бұрын

    Other suggestions for crate names: serdefied, serdefication, inserded

  • @roynrishingha
    @roynrishingha Жыл бұрын

    Hi Jon! Is it possible for you to make a similar video on `tokio` crate?

  • @Waferdicing
    @Waferdicing Жыл бұрын

    ❤️💙

  • @hyllsimon
    @hyllsimon Жыл бұрын

    It would be amazing if you could make one of these for Tauri :)

  • @mohamadbt4055
    @mohamadbt4055 Жыл бұрын

    nice

  • @lainisourgod
    @lainisourgod Жыл бұрын

    I've always pronounced it “sErde” with “e” as in “sErialize”. it sounds great for me

  • @zahash1045
    @zahash104511 ай бұрын

    Lost opportunity to call the project serdeeznuts

  • @XtremeGamesW2013
    @XtremeGamesW2013 Жыл бұрын

    Can you do winit next?

  • @gabrielmachado5708

    @gabrielmachado5708

    Жыл бұрын

    Or wgpu

  • @max_ishere
    @max_ishere Жыл бұрын

    49:26 let's just say that this is all too big brain I petition for more examples to the docs.

  • @romanstingler435
    @romanstingler435 Жыл бұрын

    +1 for AXUM

  • @sortof3337
    @sortof3337 Жыл бұрын

    yeye

  • @malborboss
    @malborboss8 ай бұрын

    Dk if its just me but Jon looked better with a beard

  • @parijatgamertv9228
    @parijatgamertv9228 Жыл бұрын

    Give me my lasagna, Jon.

  • @CrapE_DM
    @CrapE_DM5 ай бұрын

    The name serde looks Spanish to me, so I pronounce it like they would: sayr-day

  • @julesoscar8921
    @julesoscar89217 ай бұрын

    Please decrust cargo or even rust itself

  • @ewrietz
    @ewrietz Жыл бұрын

    Beard

  • @oatiz
    @oatiz Жыл бұрын

    Beard

Келесі