Articles on Rust
Last updated: 2022/08/18
Top deep-dives on Rust
Building a DB from scratch will give you a pretty good idea of how it works, and this series by João Henrique Machado Silva does exactly that. João also explains a lot of the decisions he makes, which gets a thumbs up from me.
RISC-V is one of the few (if not the only) open source instruction set architectures, and was created by academics to be viable for education, research, and practical use. In this series of articles, Stephen Marz gives a detailed outline with instruction on creating your own operating system with Rust and RISC-V.
Amos does an extensive coverage of types in Rust.
Sometimes you can fall into a deep rabbit hole when you're exploring how a programming tool works. Well this article by Amos does so in an exceptional way. Amos starts out trying to print JSON in a Linux terminal with colors, and ends up writing a Rust program.
If you start writing an application that somehow ends up being 10,000 or 100,000 lines of code, your earlier mistakes might come back to haunt you. An easy way to help reduce the chances of that is to learn from the mistakes of others! In this extensive series, Aleksey Kladov articulates the importance of an architecture file, highlights how integration and unit tests are implemented in Cargo, describes his approach to testing, brings forth tribal inline attribute knowledge, advises on organization, and promotes fast build times.
What better way to start the new year than with an exploration of some low level programming? In the first article of this series, the author goes through what it takes to print to the command line with assembly and writes a compiler in Rust that produces quines.
A virtual machine is pretty much another computer running inside of your computer's system. One excuse to build them from scratch is to better understand how computers work. Rodrigo Araujo's extensive article was created for just that reason, and Rodrigo does an excellent job of explaining those gnarly bits that leave you scratching your head (like unexplained bitwise operations).
Working with databases can be tricky business. When it comes to SQL, you'll often have to use transactions for complicated queries, because they might consist of multiple queries, business logic, and then updates or inserts, which require all the data for that transaction to be unchanged (ie not have some other update query change the value of something before the transaction is finished). In this extensive article, James Coglan demonstrates how reading and writing to a database record can be handled to reduce these kinds of issues, and some solutions for allowing limited database access when data is being worked on.
How does one turn the idea of nothing into something physical? Well Alex, you say in your most pedagogic inner voice, isn't that what 0 is? Well dear reader, it's probably up to the individual, but null is one of the more common methods. Piotr Kołaczkowski's article however, focuses on an alternative to null, the Optional or Maybe type. Piotr specifically focuses on the performance impact of using this type, as opposed to primitives, in both Java and Rust.
Reinforcement learning is basically teaching a machine learning model to produce a result based on environment variables it has access to. It involves some complicated sounding, but fundamentally simple probability jargon. Jan Corazza's article, luckily, covers the basic topics better than I can, and then dives into exploring the limitations of of the Markov property. Jan provides a solution to the problems he discovered implemented in Rust.
Aleksey Kladov demonstrates how one can generate source code without using macros in Rust, but with concepts that apply to other programming languages as well.
Raph Levien introduces a new UI framework for Rust that's powered by synchronized trees.
Rust's marvelous memory safety system comes at a cost; it's kind of a pain to implement data structures that have circular references. In this exploratory article, Eli Bendersky tries several different approaches for implementing structures that have circular references (like binary search trees).
Tristan Hume presents the "IForestIndex data structure", a spin off of an implicit binary tree, and explains how he used it to implement a trace viewer that can "smoothly zoom a trace of 1 billion randomly generated events".
In Rust, exception safety is defined as "being ready for unwinding". But that isn't the clearest explanation. Arthur Carcano has written an article that essentially explains exception safety in Rust and how it can be achieved, in the context of array initialization.There's plenty of code to show what is being talked about.
"Very often in programming we find ourselves needing access to some context object in many places in our code". In this exploratory article, Tyler Mandry presents a solution for declaring contexts in Rust that can be provided by the compiler.
Tristan Hume presents a demo project for streaming a Linux process to a remote system for execution.
Jack Huey discusses how "the NLL borrow checker finally got fully enabled by default" in Rust and how it affects you.
Amos shows how to bundle files for a Rust application using a build script. Wow!
How do you solve an issue where real-time calculations are holding up access to your database? In this article, Mike Bush discusses how he was able to resolve it at his company by building a micro-batching scheduler library in Rust.
Amos explores reducing compile times for Rust.
Alex Ilgayev covers three recent incidents involving malicious packages in the Rust and Python ecosystems.
Ralf Jung demonstrates how compiler optimizations related to pointer to integer casting can result in unwanted behavior.
Property based testing is when you test a general property of an output. It's been popularized in Haskell by the QuickTest framework. In this article however, Aleksey Kladov focuses on a specific step for property testing; "how to conveniently enumerate any kind of combinatorial object without using recursion" in Rust.
Addison Crump presents how he wrote a smart fuzzer to find vulnerabilities in rBPF, which is extensively used by the Solana blockchain.
Chris Hulbert presents a short program for writing generating PNGs in Rust.
Aleksey Kladov implements a cache in Rust and highlights some of the nuances along the way.
I guess today is an async kind of day huh? As Yoshua Wuyts correctly surmises "sometimes we start things but decide midway through that we would prefer to rather not be doing them". How would this kind of functionality be done in Rust? Yoshua's article first distinguishes between tasks and futures, then goes on to explain how cancellation propagation should work for both, how it can be backported, how to reason about structured concurrency, and much more.
Bevy is a game engine written in Rust. In this article, Pascal Hertleif describes Bevy's basic usage philosophy and how you can "type" things using labels.
"Sometimes in Rust you want to design APIs that provide a little bit of flexibility for the user". In this first part article, Armin Ronacher presents how one can do that using the Any type to get around complexities inherent in the traditional method of using generic type parameters.
You know what they say, the best defense is a strong offense! Well in the case of infosec, this is a relatively new approach. In this dangerous article, Sylvain Kerkour presents several methods for hiding and executing backdoor code in Rust crates.
Rustaceans pride themselves on the memory safety of Rust. Many a times I've heard them say, "Rust just won't allow you to make mistakes". That might be the case most of the time, but sometimes you have to go into unsafe mode, which suspends some of the stringent memory rules. In this informative article, Micah Lerner covers a paper that outlines "Rudra, a system for finding memory safety bugs in code written with the Rust programming language". Micah briefly describes Rust's memory management system, then dives into the design, implementation, and evaluation of Rudra.
Aviram Hassan and Mehul Arora cover how to hook into Go functions using Rust.
"Mononym provides the core type Named, which represents a named value of type T with a unique type N as its name". From my understanding, this allows one to create proofs in Rust that are type safe, enabling one to better implement functional programming methods. In this introductory article, Soares Chen demos how the Mononym library can be used, then goes on to discuss the technical details of its implementation.
Aleksey Kladov explains how NixOS' directory structure breaks building Rust code with LLVM's dynamic linker.
lcnr presents an unsound issue in Rust where a function can arbitrarily transmute lifetimes, causing a segmentation fault, and explores possible solutions.
Raph Levien explains how the computation of path clipping for piet-gpu (a new compute-centric 2D GPU renderer) was fully transferred to GPU from CPU.
Cliff L. Biffle compares Rust mutex API design to C, and explains why the latter is fundamentally inline with core Rust principles.