who engineers a browser?

After my attempt to write a digital breadboard, I turned back to job hunting for a while. But that quickly paled and I looked around for a project that would keep my fingers typing and my commits flowing. I stumbled across a group of folks at RC working their way through Web Browser Engineering, a book designed around writing your own web browser, so you too can appreciate all the quirks that go into loading, parsing, and displaying web content.

Chapter 1 starts out with the basics: loading webpages and printing them to the terminal. Then it gets serious: over the next few chapters, you use tkinter (if you're using Python) to render a window where you print webpages, first character by character and then word by word. By the time you hit Chapter 5, you've parsed your HTML into a tree of elements and you're creating a layout tree to match it. Chapter 6 covers CSS and exemplifies the book: the task at hand sounds daunting, but the book breaks it down (cutting scope aggressively) into something you can accomplish, and leads you through it.

Every chapter does have exercises extending the browser, which are not reflected in future chapters, so the reader's implementation diverges from the book's ideal implementation over time. This can be confusing, if you've written or refactored extra methods or different variable names, and now have to add functionality in a specific spot. But overall the exercises are a good idea, even if it might be simpler to work through the book as-written and then go back again to add the "extra" functionality in a second pass.

Working through this book with a group has been very helpful in terms of keeping myself on track; although no one was committed to a certain pace, generally everyone made some forward progress every week and we could share our wins and questions. The book doesn't say anything about testing, although there are test helpers in the repo, but nearly all of us chose to write some anyway. I fell behind on that score, and it's where I plan to pick up this project the next time I come back to it. In the meantime, my progress (through Chapter 6) is here on GitHub.