11 parts · 11 chapters

C and Systems Programming

The language underneath Node, Python, Postgres, Redis and Linux. Learning C means learning what your runtime does for you: memory you must free, syscalls you must check, and bugs no exception will catch. Measured on an Apple M3 Pro: a one-byte write() syscall costs 512 ns, while buffered fputc costs 18 ns.

Eleven parts: C from zero; pointers and memory; the toolchain (compiler, linker, loader, ELF and Mach-O); system calls; files and descriptors; processes and signals; sockets; threads; memory allocators (malloc at 23 ns versus a bump allocator at 5.4 ns, measured); undefined behaviour and sanitisers; and a capstone that builds a shell, an allocator and an HTTP server.

C from zero · pointers and memory · the toolchain · syscalls · files and descriptors · processes and signals · sockets · threads · allocators · undefined behaviour · capstonebeginner in C → senior · engineers who want to see under their runtime
languageTypes, pointers, arrays, structs and manual memory.
toolchainPreprocess, compile, assemble, link, load.
kernel interfaceSyscalls, descriptors, processes, signals.
networkSockets from socket() to an event loop with poll.
concurrencypthreads, mutexes, condition variables, atomics.
safetyUndefined behaviour, sanitisers, fuzzing.
Built on Computers and OSUses How Computers Work for memory and CPUs and Operating Systems for processes and virtual memory; Kernel Internals continues below this course.