Web Browser Engineering (2021)

MrVandemar | 676 points

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.

mannyv | 18 hours ago

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.

jm4 | 19 hours ago

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.

currygen | 18 hours ago

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

andai | 20 hours ago

One of the authors here—thank you all for the nice words. Happy to answer questions!

pavpanchekha | 18 hours ago

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

pradmatic | 15 hours ago

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!

_benj | 20 hours ago

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.

CrayKhoi | 20 hours ago

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.

austin-cheney | 19 hours ago

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

bberrry | 20 hours ago

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.

bloopernova | 15 hours ago

What an awesomely comprehensive resource, reminds me of MITRE ATT&CK.

rjurney | 7 hours ago
ilaksh | 19 hours ago

This is amazing, I just want to drop everything and start digging through this. Well done!

farmeroy | 16 hours ago

See also this previous discussion:

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

asicsp | 21 hours ago

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"

systems | 18 hours ago

This is awesome! Nice work

mvesto | 15 hours ago

hey, this book looks cool! well done :)

keepamovin | a day ago

Would be nice to have the option to download it as an epub to read it on my e-reader.

adhamsalama | 17 hours ago

Looks very cool, will definitely read it! Thanks!

adhamsalama | 17 hours ago

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/

wslh | 17 hours ago

Testing

wai-dang-loveme | 14 hours ago
[deleted]
| 19 hours ago

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

pmarreck | 18 hours ago

[flagged]

bafatik870 | 15 hours ago