October 15th, 2024

Web Browser Engineering

Web Browser Engineering, by Pavel Panchekha and Chris Harrelson, teaches readers to build a web browser using Python, covering page loading, document viewing, application running, and modern features.

Read original articleLink Icon
ExcitementAppreciationCuriosity
Web Browser Engineering

Web Browser Engineering is a forthcoming book by Pavel Panchekha and Chris Harrelson, set to be published by Oxford University Press. The book aims to demystify the workings of web browsers by guiding readers through the process of building a basic web browser using Python. It covers essential topics such as loading web pages, viewing documents, and running applications, while also addressing modern browser functionalities. The content is divided into four main parts: the first part focuses on loading pages, including downloading web pages and rendering them on the screen; the second part discusses document viewing, including HTML parsing and CSS application; the third part covers running applications, emphasizing server communication and interactive scripts; and the final part explores modern browser features like visual effects, task scheduling, and accessibility. The authors encourage readers to pre-order the book and engage with updates through their blog and social media.

- The book explains how to build a web browser using Python.

- It covers topics from loading pages to modern browser functionalities.

- The content is structured into four main parts for clarity.

- Readers can pre-order the book and follow updates online.

- The authors invite discussions and support through various platforms.

AI: What people are saying
The comments on the article about "Web Browser Engineering" reflect a strong interest in browser development and the challenges involved.
  • Readers appreciate the engaging writing and practical approach of the book, with many expressing excitement to start their own projects.
  • There is a recognition of the complexity of web technologies like CSS and JavaScript, with some commenters sharing their past experiences in browser development.
  • Several users express a desire for more independent browser engines and a broader ecosystem beyond the major players like Google and Mozilla.
  • Some commenters suggest improvements to the book's structure and content, while others inquire about formats and promotional offers.
  • Overall, there is a sense of gratitude towards the authors for their contributions to the field of browser engineering.
Link Icon 25 comments
By @mannyv - about 22 hours
One great thing about this book is the 'stuff I didn't do' part.

Layout is really hard. Just tables by themselves are hard, even without any css around them. CSS makes layout impossibly difficult. I challenge anyone to keep the whole CSS spec and its associated behaviors in their head.

At this point css + html + javascript have become a dynamic PDL, and probably is one of the most complex pieces of software today.

As an aside, video decoding is offloaded onto hardware, so it's not as battery intensive as it used to be.

By @jm4 - about 23 hours
This looks awesome. About 15 years ago, I started working on a headless browser and maintained it for several years. It used SpiderMonkey as the js interpreter and had a custom DOM implementation. It ran all the modern js from the time, AJAX, etc. Later, I added a custom Flash runtime. It basically did everything but draw to the screen. That project was a lot of fun.

I'm definitely interested in going through this book.

By @currygen - about 22 hours
It's refreshing that browser engineering seems to become a "trend" now. The ecosystem is quite sparse with basically only Google, Apple and Mozilla defining it. I'd like to see forward into a future with more independent browser engines.
By @andai - about 24 hours
The author's post explaining why Python was chosen: https://browserbook.substack.com/p/why-python

Apparently some of it now runs in the browser ("in the book itself") by compiling Python to JS?

https://browserbook.substack.com/p/compiling-python-to-js

By @pavpanchekha - about 22 hours
One of the authors here—thank you all for the nice words. Happy to answer questions!
By @pradmatic - about 19 hours
I've been looking for a fun project to start and I'm already thoroughly enjoying this book. Kudos for making the writing particularly engaging.

This comic book about how Chrome works is also a great place to get started: https://www.google.com/googlebooks/chrome/med_00.html

By @_benj - about 23 hours
It is so exciting to see material like this being made!

Browsers seem like mysterious, undecipherable black boxes, which is very likely how G wants them to be perceived, but that is cracking by seeing the efforts/results of such projects like ladybird and others!

I hope to one day be able to jump in and contribute to break that moat! And this books looks like an amazing start!

By @CrayKhoi - about 24 hours
I've been levelling up on browser internals, and this book is awesome. It helps build up intuition on how browsers work, without going through the millions of lines of chrome code.
By @austin-cheney - about 22 hours
Nice book. I would recommend splitting chapter 9 into two separate chapters where executing JavaScript via Duktape is one chapter and then interacting with the DOM and events are a separate later chapter.
By @bberrry - 1 day
I'm so incredibly thankful that there are people like Pavel and Chris putting effort into articles like this. You are truly the best of us
By @bloopernova - about 19 hours
This is wonderful!

I had an opportunity to run a tutorial on basic command line usage for newer software engineers. It's always fun to see people's expressions or read their reactions to seeing me telnet to port 25 and 80.

By @rjurney - about 11 hours
What an awesomely comprehensive resource, reminds me of MITRE ATT&CK.
By @ilaksh - about 22 hours
By @farmeroy - about 20 hours
This is amazing, I just want to drop everything and start digging through this. Well done!
By @asicsp - 1 day
See also this previous discussion:

https://news.ycombinator.com/item?id=28898157 (409 points | Oct 19, 2021 | 63 comments)

By @systems - about 21 hours
why python, why not a system programming language like C, OCaml or Go (or newer languages like zig or odin)

Are web browsers, not considered to be "system software"

By @mvesto - about 19 hours
This is awesome! Nice work
By @keepamovin - 1 day
hey, this book looks cool! well done :)
By @adhamsalama - about 21 hours
Would be nice to have the option to download it as an epub to read it on my e-reader.
By @adhamsalama - about 21 hours
Looks very cool, will definitely read it! Thanks!
By @wslh - about 21 hours
Is there a promotional code for HN? I was a happy user of HTMLUnit [1] with Jython [2] in the past and am very interested in a future where we can automatically generate portions of browser code using code generation and verification techniques. I've never felt as comfortable with tools like Playwright/Cypress/Selenium as I did with HTMLUnit (with all due respect to both).

[1] https://htmlunit.sourceforge.io/

[2] https://www.jython.org/

By @wai-dang-loveme - about 17 hours
Testing
By @pmarreck - about 21 hours
I hope the AI gets good enough to dynamically translate from one language to another with high reliability, in case not everyone is a fan of Python