Articles on Rust

Last updated: 2022/08/18

Top deep-dives on Rust

What would SQLite look like if written in Rust? — Part 1

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.

The Adventures of OS: Making a RISC-V Operating System using Rust

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.

The curse of strong typing

Amos does an extensive coverage of types in Rust.

A terminal case of Linux

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.

One Hundred Thousand Lines of Rust

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.

Post #0: In Which I Set Out to Write a Terrible Compiler for a Useless Language

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.

Let’s build an LC-3 Virtual Machine

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).

Reading and writing, part 2: files and databases

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.

Overhead of Returning Optional Values in Java and Rust

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, non-Markov environments, and memory

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.

Self Modifying Code

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.

Xilem: an architecture for UI in Rust

Raph Levien introduces a new UI framework for Rust that's powered by synchronized trees.

Rust data structures with circular references

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).

Implicit In-order Forests: Zooming a billion trace events at 60fps

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".

Exception safety in Rust: using transient droppers to prevent memory leaks

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.

Contexts and capabilities in Rust

"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.

Teleforking a process onto a different computer!

Tristan Hume presents a demo project for streaming a Linux process to a remote system for execution.

The Rust borrow checker just got (a little bit) smarter

Jack Huey discusses how "the NLL borrow checker finally got fully enabled by default" in Rust and how it affects you.

One funny way to bundle assets

Amos shows how to bundle files for a Rust application using a build script. Wow!

A prioritised micro-batch scheduler in rust

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.

When rustc explodes

Amos explores reducing compile times for Rust.

TypoSquatting, RepoJacking, and Domain Takeover – The Story of the Recent Attacks

Alex Ilgayev covers three recent incidents involving malicious packages in the Rust and Python ecosystems.

Pointers Are Complicated III, or: Pointer-integer casts exposed

Ralf Jung demonstrates how compiler optimizations related to pointer to integer casting can result in unwanted behavior.

Generate All the Things

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.

Earn $200K by fuzzing for a weekend: Part 1

Addison Crump presents how he wrote a smart fuzzer to find vulnerabilities in rBPF, which is extensively used by the Solana blockchain.

Rust PNG writer from scratch

Chris Hulbert presents a short program for writing generating PNGs in Rust.

Caches In Rust

Aleksey Kladov implements a cache in Rust and highlights some of the nuances along the way.

Async Cancellation I

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.

How Bevy uses Rust traits for labeling

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.

Rust Any Part 1: Extension Maps in Rust

"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.

Backdooring Rust crates for fun and profit

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.

Rudra: Finding Memory Safety Bugs in Rust at the Ecosystem Scale

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.

Hooking Go from Rust - Hitchhiker’s Guide to the Go-laxy

Aviram Hassan and Mehul Arora cover how to hook into Go functions using Rust.

Mononym: Type-Level Named Values in Rust - Part 1: Demo and Implementation

"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.

RPATH, or why lld doesn’t work on NixOS

Aleksey Kladov explains how NixOS' directory structure breaks building Rust code with LLVM's dynamic linker.

Diving Deep: implied bounds and variance

lcnr presents an unsound issue in Rust where a function can arbitrarily transmute lifetimes, causing a segmentation fault, and explores possible solutions.

piet-gpu progress: clipping

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.

Why Rust mutexes look like they do

Cliff L. Biffle compares Rust mutex API design to C, and explains why the latter is fundamentally inline with core Rust principles.


Want to see more in-depth content?

subscribe to my newsletter!

Other Articles