Computer science students find operating systems, compilers, and databases mysterious, leaving them powerless over part of their computing environment. So,Others reasons for these classes: a focus on speed; learning low-level APIs; practice with C; knowing the stack; using systems better; and the importance of the system covered. a computer science degree traditionally includes courses that replace mystery with code, so that Linux, Postgres, and LLVM look like improvements, additions, and optimizations atop an understandable core.
But web browsers are still opaque, not just to students but to faculty and industry programmers. This book dissipates this mystery by systematically explaining all major components of a web browser.
The text constructs a basic browser weighing in around 1000 lines of code (twice that if you also do the exercises). Most of the chapters will take 4–6 hours to read, implement, and debug for someone with a few years’ programming experience, though some chapters (like 5 and 6) are more difficult and may take twice as long.
Your web browser will “work” every step of the way, and every chapter will build upon the last.This idea is from J. Wilcox, inspired in turn by S. Zdancewic's course on compilers. That way, you will also practice growing and improving complex software. The text tries to avoid unnecessary changes and refactorings. If you feel particularly interested in some component, you can flesh it out and add missing features without making later chapters more difficult.
James R. Wilcox and I dreamed up this course during a late-night chat at ICFP 2018. Max Willsey proof-read and helped sequence the chapters. Zach Tatlock encouraged me to develop this into a course. I am thankful to all of them. I also thank the students of CS 6968, who found many errors and suggested important simplifications.
This book is, and will remain, a work in progress. Please leave comments and mark typos; the book has built-in feedback tools, which you can enable with
Ctrl+E. Full source code is available on GitHub.