A Neural Network from Scratch
Build and train a neural network from first principles: forward pass, loss functions, and gradient descent optimization.
Python · TypeScript
Mark-and-sweep from scratch. Manage memory the way the runtimes you use daily do without you noticing.
Build it in your language
The tester treats your program as a black box: any language works. These are just the most convenient ones for this project.
If you program in a garbage-collected language, there's a component constantly deciding what lives and what dies in your program, and you've never seen it. Here you write it.
You'll build your own heap with its allocator, a mark-and-sweep collector on top of it, and the improvements real runtimes use: generational collection and compaction. And you'll measure the pauses, which is where the hard part lives.
9 stages across 4 phases. Every stage comes with its guide and its tests: you move on when they pass.
Reserve memory, write an allocator, and represent objects with a header.
Roots, traversal of the object graph, marking and freeing.
Free list, fragmentation, and automatic collection triggering.
Generational collection with a nursery, write barriers, and measured compaction.
Build and train a neural network from first principles: forward pass, loss functions, and gradient descent optimization.
Python · TypeScript
namespaces, cgroups and chroot. Isolate a process by hand and understand what Docker does when it starts an image.
Go · C · Rust
fork, exec, pipes and redirection. Build a POSIX command interpreter that runs real programs.
C · Rust · Go · Zig