Rust in Practice

Writing software is a craft. I’ve been writing software code for a long time, and currently I write a lot of Rust. These posts are about writing it well in the context I actually work in, which is data-intensive and scientific software. Error handling, tracing and observability, serialisation, and using the type system to encode things that matter. I try to demystify the language and show how to use it to write software that is reliable, maintainable, and easy to understand.

Rust in Practice
crane blue

The Builder Pattern for Complex Records

Learn how to use the builder pattern in Rust to construct complex records in a flexible and readable way. This helps manage optional fields and maintain code clarity in data pipelines, and can help your data science and engineering teams build more reliable and maintainable systems.

Read More
presentation_outline_2 green

Logs and tracing in Rust: From Terminal to Grafana

How to ship structured logs from a Rust application to Grafana Loki and query them, with a complete local setup using Docker Compose.

Read More
log1 orange

Logs and tracing in Rust: Structured Fields and Spans

How to use structured fields and spans in the Rust tracing crate to add context to your logs and understand the flow of execution in your code.

Read More
log1 blue

Logs and tracing in Rust: Fundamentals

An introduction to logging and tracing in Rust, covering some of the philosophy behind logging and how to set up a basic tracing subscriber in your Rust projects.

Read More
crab yellow

Why Rust for Data-Intensive Applications

Explores why Rust matters for research data pipelines - not for performance, but for correctness. Learn how Rust's type system prevents data failures.

Read More
errors green

Your Errors Are Data Too

How Rust's error handling patterns let you treat errors as structured observations about your data - capturing context, categorising failures, and producing data quality reports as first-class pipeline outputs.

Read More
head_brain yellow

Why Use Newtypes? Encoding Domain Knowledge in the Type System

How Rust's newtype pattern lets you encode domain knowledge - valid ranges, clinical thresholds, meaningful operations - directly into the type system, so the compiler enforces what you already know to be true about your data.

Read More
table orange

Serde Rust: Data Serialisation for Data Scientists

Practical Rust patterns for building validated data pipelines with Serde. Custom deserialisers, domain-constrained types, streaming CSV processing, and structured error handling for messy real-world data.

Read More
brackets yellow

Accidental Functional Programming in Rust (From an Epidemiologist's Perspective)

Rust quietly pushes you into functional patterns. An epidemiologist explains Result, match, enums, iterators, and when readability beats idioms.

Read More