Long-form Texts on Interesting Details of Computers
It seems especially recently I’ve come across more and more long-form texts (think: hour-long blog posts; free books; series of posts). I especially like the ones that go into the very fine details of some niche topic and maybe also ramble a bit about completely unrelated but highly entertaining asides. And while I will probably never have enough time to read them all, I decided to at least collect some of them here for future reference. I’ll do my best to add summaries, and to update this list semi-regularly.
Contents
- “Learn Rust With Entirely Too Many Linked Lists” by Alexis Beingessner
- “Programming Algorithms” by Vsevolod Domkin
- “Aspects of Rust” by multiple people
- “Command Line Applications in Rust” by Pascal Hertleif
- “Learn Rust the Dangerous Way” by Cliff L. Biffle
- “Reading files the hard way” by Amos Wenger
- “Making our own ping” by Amos Wenger
- “Making our own executable packer” by Amos Wenger
- “Parsing” by Aleksey Kladov
- “JavaScript Allongé” by Reg “raganwald” Braithwaite
- “Crafting Interpreters” by Robert Nystrom
- “A relatively simple Datalog engine in Rust” by Frank McSherry
- “Non-lexical lifetimes” by Niko Matsakis
- “Shifgrethor” by Without Boats
- “Rayon/Parallel Iterators” by Niko Matsakis
- “How Rust optimizes async/await” by Tyler Mandry
- “Writing an OS in Rust” by Philipp Oppermann
- “Learning Parser Combinators With Rust” by Bodil Stokke
- “Manish vs. ASCII” by Manish Goregaokar
- “The Wayland Protocol” by Drew DeVault
- “Programming Feedback for Advanced Beginners” by Robert Heaton
“Learn Rust With Entirely Too Many Linked Lists” by Alexis Beingessner
(~180 pages; archived)
The premise of this book is that writing a linked list is a beginner’s exercise in C but quite difficult to get right in Rust. So it takes that as an opportunity to do just what the title says: It teaches you Rust by implementing a linked list type in Rust, in five (as of April 2020) different ways.
Niches: data structures; linked lists; rust; smart pointers
Last update I saw: 2019-03-21
“Programming Algorithms” by Vsevolod Domkin
(~300 pages; archived)
Book covering a lot of different data structures and algorithms. “Its aim is to systematically explain how to write efficient programs and, also, the approaches and tools for determining why the program isn’t efficient enough.”
Niches: data structures; algorithms; lisp
Last update I saw: 2020-04-16
“Aspects of Rust” by multiple people
Several stand-alone posts by various people whose only connection is that they cover nice aspects of Rust.
Niches: rust
-
A half-hour to learn Rust (archived)
Whirlwind tour through Rust as a language by Amos Wenger.
-
Diving into Rust with a CLI (archived)
Small tutorial by Kevin Knapp on how to write a XKCD downloader tool in Rust.
-
By Aleksey Kladov.
-
The Secret Life of Cows (archived)
The Clone-on-Write smart pointer explained by yours truly.
-
Newtype Index Pattern (archived)
By Aleksey Kladov.
-
How to implement a trait for
&str
and&[&str]
(archived)Some musing on traits and borrows by yours truly.
-
Declarative memory management (archived)
By Amos Wenger. Introducing the complexities of memory management and the ways Rust tries to represent them in a nice roundabout way.
-
Return-type based dispatch (archived)
By yours truly. By specifying at some later point in the code which type you want your function to return, the compiler can go back and fill in the blanks.
-
Working with strings in Rust (archived)
By Amos Wenger. Following the memory management post, this looks at how strings are actually pretty complicated and what Rust does about them.
-
Writing Non-Trivial Macros in Rust (archived)
By Michael F. Bryan.
“Command Line Applications in Rust” by Pascal Hertleif
(~45 pages; archived)
A tutorial on how to write CLI apps in Rust, learning many aspects of the ecosystem along the way.
Last update I saw: 2020-06-12
“Learn Rust the Dangerous Way” by Cliff L. Biffle
Rust explained for low-level developers without a CS background. If you’ve been writing firmwares or kernels or game engines and want to dip your toes into Rust, this a good start. Full index of series here.
Niches: rust; systems programming; memory management
- Why Learn Rust the Dangerous Way? (archived)
- You Can’t Write C in Just Any Ol’ Language (archived)
- References Available Upon Request (archived)
- Measure What You Optimize (archived)
- A More Perfect Union (archived)
- Making Safe Things From Unsafe Parts (archived)
- Let The Compiler Do The Work (archived)
“Reading files the hard way” by Amos Wenger
Writing files seems like a solved problem. But that doesn’t mean we can’t solve it again from scratch.
Niches: POSIX; file systems; syscalls
- Part 1 (node.js, C, rust, strace) (archived)
- Part 2 (x86 asm, linux kernel) (archived)
- Part 3 (ftrace, disk layouts, ext4) (archived)
“Making our own ping” by Amos Wenger
- A short (and mostly wrong) history of computer networking (archived)
- Windows dynamic libraries, calling conventions, and transmute (archived)
- FFI-safe types in Rust, newtypes and MaybeUninit (archived)
- Designing and implementing a safer API on top of LoadLibrary (archived)
- A simple ping library, parsing strings into IPv4 address (archived)
- The builder pattern, and a macro that keeps FFI code DRY (archived)
- Finding the default network interface through WMI (archived)
- Binding C APIs with variable-length structs and UTF-16 (archived)
- Consuming Ethernet frames with the nom crate (archived)
- Improving error handling - panics vs. proper errors (archived)
- Parsing IPv4 packets, including numbers smaller than bytes (archived)
- Parsing and serializing ICMP packets with cookie-factory. (archived)
- Crafting ARP packets to find a remote host’s MAC address (archived)
- Crafting ICMP-bearing IPv4 packets with the help of bitvec (archived)
“Making our own executable packer” by Amos Wenger
- What’s in a Linux executable? (archived)
- Running an executable without exec (archived)
- Position-independent code (archived)
- ELF relocations (archived)
- The simplest shared library (archived)
- Loading multiple ELF objects (archived)
- Dynamic symbol resolution (archived)
- Dynamic linker speed and correctness (archived)
- GDB scripting and Indirect functions (archived)
- Safer memory-mapped structures (archived)
- More ELF relocations (archived)
- A no_std Rust binary (archived)
- Thread-local storage (archived)
“Parsing” by Aleksey Kladov
Not a real series of articles but a collection of posts by someone whose Github bio reads “Stuck writing parsers”.
Niches: parsers
- Modern Parser Generator (archived)
- Simple but Powerful Pratt Parsing (archived)
- From Pratt to Dijkstra (archived)
“JavaScript Allongé” by Reg “raganwald” Braithwaite
(~530 pages; archived)
Niches: functional programming; obscure JavaScript
Last update I saw: 2019-04-26
“Crafting Interpreters” by Robert Nystrom
(~800 pages; archived)
Last update I saw: 2020-04-05
“A relatively simple Datalog engine in Rust” by Frank McSherry
(~20 pages; archived)
Building a datalog engine in Rust.
Niches: datalog
“Non-lexical lifetimes” by Niko Matsakis
One of the main features of the Rust language is the concept of ownership and lifetimes. This series of posts by Niko Matsakis, one of the designers of the Rust language, is about the theory and practical implementation of a revamped and more complete way of this in the Rust compiler. It starts in early 2016 and goes all the way to after they feature landed (end of 2018).
- Introduction (archived)
- Non-lexical lifetimes based on liveness (archived)
- Adding the outlives relation (archived)
- Using liveness and location (archived)
- Nested method calls via two-phase borrowing (archived)
- Draft RFC and prototype available (archived)
- An alias-based formulation of the borrow checker (archived)
- MIR-based borrow check (NLL) status update (archived)
- MIR-based borrowck is almost here (archived)
- Interprocedural conflicts (archived)
- Polonius and region errors (archived)
- Polonius and the case of the hereditary harrop predicate (archived)
“Shifgrethor” by Without Boats
A proposed API for a GC in Rust.
- Garbage collection as a Rust library (archived)
- Notes on tracing garbage collectors (archived)
- Rooting (archived)
- Tracing (archived)
“Rayon/Parallel Iterators” by Niko Matsakis
Niches: concurrency
- Rayon: Data parallelism in Rust (archived)
- Parallel Iterators Part 1: Foundations (archived)
- Parallel Iterators Part 2: Producers (archived)
- Parallel Iterators, part 3: Consumers (archived)
“How Rust optimizes async/await” by Tyler Mandry
Niches: compilers; memory layout
“Writing an OS in Rust” by Philipp Oppermann
Niches: operating systems, assembler
- A Freestanding Rust Binary (archived)
- A Minimal Rust Kernel (archived)
- VGA Text Mode (archived)
- Testing (archived)
- CPU Exceptions (archived)
- Double Faults (archived)
- Hardware Interrupts (archived)
- Introduction to Paging (archived)
- Paging Implementation (archived)
- Heap Allocation (archived)
- Allocator Designs (archived)
- Async/Await (archived)
“Learning Parser Combinators With Rust” by Bodil Stokke
(~60 pages; archived)
Assuming you know Rust, this teaches you the fundamentals of parser combinators in a very hands-on way.
Niches: parsers
“Manish vs. ASCII” by Manish Goregaokar
Several posts on why assuming text is ASCII is unhelpful.
Niches: unicode
-
Let’s Stop Ascribing Meaning to Code Points (archived)
tl;dr you should not index into a Unicode text, like, ever.
-
Breaking Our Latin-1 Assumptions (archived)
Examples for scripts/languages that really don’t work if you assume you have ASCII text.
-
Picking Apart the Crashing iOS String (archived)
Fun analysis of a Unicode rendering bug that crashed iOS devices.
“The Wayland Protocol” by Drew DeVault
(~156 pages; archived)
“Wayland is the next-generation display server for Unix-like systems[…] This book will help you establish a firm understanding of the concepts, design, and implementation of [it]”.
Niches: wayland; graphics; protocols; unix
“Programming Feedback for Advanced Beginners” by Robert Heaton
“Specific, actionable ways to make your code cleaner.” Targeting intermediate programmers who are looking for entertaining writing they can learn something from.
Full index of series here.
- Programming Feedback for Advanced Beginners #0 (archived)
- Define your boundaries (archived)
- How to structure your programs (archived)
- How to rigorously analyze your journey to work (archived)
- Exception handling and coping with failure (archived)
- How to make your programs shorter (archived)
- Real-world debugging practice (archived)
- How to write a library (archived)
- Input validation - tradeoffs between convenience and surprise (archived)
- Batch vs Stream processing (archived)
- First-class functions and dependency injection (archived)
- Separating logic and data (archived)
- Systems design for advanced beginners (archived)
- When code is too clever to be clean (archived)
- Evil
eval
(archived) - Don’t overwork your functions (archived)
- How to make your code faster and why you often shouldn’t bother (archived)
- pre-computation sounds like cheating but isn’t (archived)
- Adventures in shrinking serialized data (archived)