Menu
Sign In Search Podcasts Libraries Charts People & Topics Add Podcast API Blog Pricing

Matthias Endler

๐Ÿ‘ค Speaker
692 total appearances

Appearances Over Time

Podcast Appearances

Rust in Production
Gama Space with Sebastian Scholz

How do you review Rust code for correctness?

Rust in Production
Gama Space with Sebastian Scholz

What do you look out for?

Rust in Production
Gama Space with Sebastian Scholz

What are some common patterns that you found useful here?

Rust in Production
Gama Space with Sebastian Scholz

It turns out there's not a lot of space in space.

Rust in Production
Gama Space with Sebastian Scholz

You work on tiny hardware.

Rust in Production
Gama Space with Sebastian Scholz

And shout out to Vegard as well.

Rust in Production
Gama Space with Sebastian Scholz

It was an amazing episode too.

Rust in Production
Gama Space with Sebastian Scholz

Now, Rust has fallible allocations for vectors nowadays, but...

Rust in Production
Gama Space with Sebastian Scholz

I'm guessing that you even want to avoid allocations in the first place, especially the dynamic allocations.

Rust in Production
Gama Space with Sebastian Scholz

And Oxide, for example, has a scheduler called Hubris.

Rust in Production
Gama Space with Sebastian Scholz

And Steve, please correct me if I'm wrong here, but Steve Klapnick, that is.

Rust in Production
Gama Space with Sebastian Scholz

I think what they did was they used static allocation, static memory, and every payload that they run on that scheduler has a fixed size known at compile time, which allows you to have predictable allocations.

Rust in Production
Gama Space with Sebastian Scholz

Do you use that pattern as well, if you can?

Rust in Production
Gama Space with Sebastian Scholz

So having a fixed struct and knowing that only this struct will need to be allocated, quote unquote, on the stack?

Rust in Production
Gama Space with Sebastian Scholz

If I understand correctly, that means you don't initialize the struct.

Rust in Production
Gama Space with Sebastian Scholz

You have a view into this byte block in this block of bytes and zero copy kind of makes it safe for you.

Rust in Production
Gama Space with Sebastian Scholz

well that's really nice it's a nice example of making illegal state impossible to represent and parsing instead of validating that's kind of cool you said that zero copy is a bit like a safe transmute would that mean you can ditch transmute altogether and always use zero copy or are there any cases where zero copy just doesn't provide a safe interface

Rust in Production
Gama Space with Sebastian Scholz

Okay, you try to minimize unsafe code.

Rust in Production
Gama Space with Sebastian Scholz

Do you also try to minimize unwraps?

Rust in Production
Gama Space with Sebastian Scholz

Are there any better patterns that you use?