Watermarked preview · swipe or use ← →
From Simulation to Production, Squeeze Every Cycle
You vectorized the loop. You still waited.
Every scientific programmer knows the ceiling. NumPy carried you past pure
Python, and for a while it is enough. Then the grid gets finer, the sweep gets
wider, and the vectorized code that once felt fast becomes a forty-minute wait
you schedule your day around. You profile it, and the answer stings: the
bottleneck is not your algorithm. It is the language.
This book is for the reader standing at that ceiling who needs to go not
marginally further, but an order of magnitude further.
It teaches the specific parts of Rust that turn a numerical workload from a
coffee-break wait into an interactive one: code that runs on every core at once,
processes eight values per instruction with SIMD, solves a sparse system in
seconds instead of minutes - and then calls straight back into Python, so your
whole analysis ecosystem stays intact while the heavy computation moves to Rust.
NO SYSTEMS BACKGROUND REQUIRED
The book assumes you can write a program. It does not assume you have ever
thought about a cache line, a memory layout, or a borrow checker. Every idea
that matters for performance is built from the ground up, at the moment it
earns its place - explained in terms a Python and NumPy user already
understands, never in terms of C++.
WHAT YOU WILL BE ABLE TO DO
- Write a benchmark you can actually trust, and measure before you optimize
- Lay out data so the cache works for you instead of against you
- Use SIMD to process many values per instruction - by hand and automatically
- Parallelize loops across every core with Rayon, safely
- Do real linear algebra with nalgebra and faer
- Integrate ODEs, run Monte Carlo simulations, and compute FFTs at speed
- Solve large sparse systems with iterative methods
- Call Rust from Python with zero-copy NumPy interoperability
- Profile like a professional, and know when the GPU is worth it - and when
it is not
THE ARC OF THE BOOK
Fifteen chapters in four parts take you from a slow simulation to a production
pipeline. Part 1 gives you the language and a trustworthy benchmark. Part 2 is
the heart: memory layout, the cache, SIMD, and fearless parallelism. Part 3
applies all of it to the real work of scientific computing - linear algebra,
ODEs, Monte Carlo, FFT, sparse solvers, and the Python bridge. Part 4 goes
beyond the CPU into GPU offloading with wgpu and distributed patterns, then
closes with a capstone that assembles the entire book into one high-throughput
simulation pipeline, measuring the speedup at every step.
Every chapter ends with a quiz, and every answer is explained in Appendix A -
not merely marked. A companion download provides a complete, runnable Cargo
project for every chapter, including the Python-interop extensions, so nothing
here is theoretical.
WHY THIS BOOK AND NOT A GENERAL RUST BOOK
General Rust books teach web servers and borrow-checker puzzles. This one stays
on one question: how do you make numerical code fast? Rayon, SIMD, and
cache-aware layout are the main event, not an appendix - and every technique is
measured, never asserted.
PREREQUISITES
You can write programs, probably in Python with NumPy. That is enough. No Rust,
no C, no systems programming, no computer science degree.
Part of the RUST IN PRACTICE series from Waskey Press. Each volume stands
completely alone - no prior volume required.
No reviews yet — be the first to share your thoughts.
Share your experience with this book. Reviews are moderated before publication to keep discussions useful and respectful.