Web Browser Engineering (2021)

MrVandemar | 770 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 | a year 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 | a year 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 | a year ago

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

pavpanchekha | a year 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 | a year 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 | a year 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 | a year 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 | a year 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 | a year 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 | a year ago

Some major problems that browsers have to deal with have to do with UI. Specifically:

1. Users expect the UI to update in realtime,

2. Developers expect the UI to update in realtime,

3. UIs tend to be single threaded, and

4. The principles of software engineering and the reality of software stress encapsulation, but the realtime nature of UI requires visibility into these processes.

And of course this impacts the Javascript layer, since this is yet another environment with the same constraints as above.

mannyv | a year 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 | a year 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 | a year ago
ilaksh | a year ago

See also this previous discussion:

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

asicsp | a year ago

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

farmeroy | a year ago

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

adhamsalama | a year ago

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

rjurney | a year 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 | a year ago

Looks very cool, will definitely read it! Thanks!

adhamsalama | a year 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 | a year ago

This is awesome! Nice work

mvesto | a year ago

hey, this book looks cool! well done :)

keepamovin | a year ago
[deleted]
| a year ago

[flagged]

wai-dang-loveme | a year ago

[flagged]

bafatik870 | a year ago