The Rustacean Station Podcast

This Week in Rust - Issue 346

Episode Page with Show Notes

Nell Shamrell-Harrington: Hello and welcome to another episode of This Week in Rust on the Rustacean Station! As always, I’m Nell Shamrell-Harrington, lead editor of This Week in Rust and also a Sr. Staff Research Engineer on the Rust team at Mozilla.

Let’s dive right into some featured stories from This Week in Rust issue number 346.

First, a few announcements from the Rust organization. The RustUp Working Group has published a post announcing Rustup 1.22.0. Rustup is the recommended tool to install Rust — see the post for all of the details about this new version. Additionally, Ashley Mannix has published “Ownership of the standard library implementation” on behalf of the Library or Libs team. The Rust project is re-organizing standard library activities between the Libs team and the Compiler team. Going forward, the Libs team will own the public API of the standard library, while the Compiler team will own the standard library’s implementation. Both teams are looking for more help from the community. If you are interested in identifying and capturing idioms as standard APIs, check out the Libs team. If you are interested in working on a big codebase used by almost every Rust developer, check out the Compiler team. There are details on how to contact both teams in the post.

If you are looking for an exploration of Rust web frameworks, look no further than Luca Pamieri’s post titled “Choosing a Rust web framework, 2020 edition”. This is a very thorough overview of the main web frameworks in the Rust ecosystem including Actix-web, Rocket, Tide, and Warp

In this article Palmieri breaks down each framework and explains where it stands when it comes to comprehensiveness, community and adoption, sync vs async as well as their choice of futures runtime, documentation, tutorials and examples, and API and ergonomics. Definitely read the article for the full analysis of all these runtimes and recommendations.

Saim Irfan, who’s article on Rocket we featured last week on this podcast, has already published a follow on titled “Simple Rocket Web Framework Tutorial POST Request”. This follow up to last week’s post takes the reader through how to use Rocket to create a form that submits a POST request.

Andrei Homescu has published a post on “Transpiling a Kernel Module to Rust: The Good, the Bad and the Ugly”. In the post, Homescu takes a Linux kernel module — specifically the Bareflank Hypervisor SDK, and transpiles it to Rust. The post covers translating the C files into Rust, compiling the generated Rust, and linking everything into a loadable kernel module.

This week we saw Boats back with another blog post called “RingBahn II: The Central State Machine”. Their previous blog post introduced Ringbahn - a safe API for using io-uring from Rust. IO-uring is a way to do asynchronous input output programming, also known as IO programming, under Linux with very low performance overheads. Ringbahn is a project which attempts to define a good interface to perform IO on io-uring through Rust. Boat’s post is a deep dive into the core state machine of Ringbahn — which is what makes it memory safe. Check out the post for the full details.

Also related to memory safety, Dylan Kerler has published a post titled “What is a Dangling Pointer?”. The article starts by defining what exactly a pointer is, it’s a fixed size integer that points to a location in memory. It then goes on to explain that a dangling pointer happens when you have a pointer to a location of memory where a value was once stored, but the value has since been dropped. In languages like C++, dangling pointers can cause errors that are not discovered until runtime. The article then goes through how the Rust compiler will not allow you to create a dangling pointer — compiling will fail and you will get an error telling you how to fix it. This article also covers smart pointers in Rust.

Firo Solutions has published a blog post called “Super Hero Rust Fuzzing”. It defines fuzzing as “the art of finding bugs by feeding a program automated generated data”. It also covers several different fuzzing solutions you can use with your Rust code including American Fuzzy Loop (or AFL), LibFuzzer, Hongfuzz, and Address Sanitizer

Moving onto RFCs, one new RFC was proposed this week called “IndexGet and IndexSet”. This RFC addresses the fact that some collections — such as BitSet or Cache — are unable to return direct references to the elements in that collection. This means that syntax we would use to access the elements of an array or a vec currently does not work with them. This RFC proposes two new traits — IndexGet and IndexSet — that would allow a user to use this syntax with these kinds of collections.

3 RFCs are now in final comment period. The first of these proposes adding a new function attribute called instruct set that allows you to declare what instruction set should be used when compiling a function. An instruction set is an agreement about how software will communicate with the processor. Some processors support having more than one instruction set used within a single program. Adding the instruction set attribute allows someone to use multiple instruction sets within a piece of Rust code. This attribute would initially only be usable with certain ARM architectures, but other architectures could be in added later.

The second RFC is titled “Inline Constant Expressions and Patterns.” This RFC introduces a new syntax which instructs the compiler to execute the contents of a block at compile time. An inline constant can be used as an expression or anywhere in a pattern where a named constant would be allowed

The third RFC in final comment period is titled “Inline Assembly.” This RFC proposes a more user friendly syntax for including inline assembly in Rust code. I encourage you to read the RFC for full details.

No RFCs were approved this week.

Moving onto events, it is still so wonderful to see so many meetups from around the world available to attend online. I personally had the pleasure of attending the Rust Dublin meetup last week. One tip on attending these remote meetups — make sure to RSVP on Meetup.com before the meetup starts, that way you will be able to see the Zoom link when the time comes.

There are upcoming remote events in Berlin, San Diego, CA, Turin, IT, and my own hometown of Seattle, WA. Additionally, some meetups are, at this time, planning to meet in person including in Atlanta, GA, Lehi, UT, and Vancouver, BC. As the COVID-19 pandemic is still an evolving situation, please be sure to check the meetup page before you go just in case the meetup is moved to another location or online.

As for Rust jobs, there are currently two Rust development opportunities at 1Password. Check out the links in the newsletter for all of the details.

And that’s all for this episode of the This Week in Rust podcast. Make sure to read the newsletter for even more great Rust content.

This Week in Rust is edited by myself, Andre Bogus, and Colton Donnelly. This week’s contributors included, using their GitHub usernames, Thedataking, Inshlayaz, Jasonwilliams, Pliniker, and delan

As always, if you write a great article on Rust or happen to see one please submit it to This Week in Rust by opening a pull request on our GitHub repo. Have a wonderful week everyone and please take care!