202 points · by ibobev · 1w ago · 29 comments
I finished going through this in July this year. Here are my thoughts at the time: https://calvinlc.com/p/2026/07/23/browser.html
No questions, just gratitude!
I'm on the path to building a browser. I had vaguely remembered this site from when it was listed before, but I couldn't find it when looking again. It's bookmarked now. :)
I'm writing my own libraries (because, with AI, why not indulge in low-level fun?), and I'm almost to the layout engine.
So far (all C libraries), I can read multiple image formats, parse HTML/XML and CSS, rasterize text and just about anything that can be required by CSS or SVG. Fonts were fun... I can do TTF but not WOFF yet. I can do some WASM, but no JS engine yet. I do have my Regex engine, though. (I had built WASM first because it's being used for another project). Still a long way to go. Only approx 780K lines spread out across 30 or so libraries written so far.
I'm sure you have your reasons but this sounds like a disaster waiting to happen. Jonathan Blow might be able to never write memory bugs but something as big as a browser will likely, eventually have more than you edit it, or the you of the future is not the same you of today and so will forget all the issues that C is not preventing you making.
A browser needs to be one of the most hardened pieces of software there is since it runs untrusted code. All the browser makers are trying to figure out ways out of their C++ legacy use-after-free exploit hell. Servo in rust, LadyBird going rust, WebKit considering switching to all Swift, Chrome converting portions to rust.
Email: eren@evenstamp.com
edit: never mind, found it for sale :)
Congratulations on not slopping out
I skipped around a bit, but when I stumbled onto this opinion I backed out.
This is not the point of wasm at all. Wasm is there as a compatibility layer and for squeezing extra performance out of critical sections of code. The decisions to restrict its API access are very sensible. We can't honestly still be confused about this in 2026.
I excused the python code since a serious browser is not the point, but I'm now suspicious of other intuition-building done throughout the rest of the book.
In any case, this line is in the appendix describing what we didn't cover and, per that, we don't say anything else about WebAssembly in the book!
I've worked with wasm and am fairly familiar with the ecosystem. it sounds like it captures the essence quite well
Direct DOM access would make it possible to build full sites in Rust or C. There is no real security tradeoff and very little complexity (expose an existing API to an existing runtime). In return you get a web that's faster and completely open in terms of languages.
Right now the only options are use canvas and draw everything from scratch, or have a JS layer that transfers messages between the code and browser. You have to choose bloated size and zero accessibility, or pure overhead from copying data back and forth.
You know the people who thought Java Applets, Flash, and Sliverlight were Wonderful Ideas would be on top of that one.
Solutions like this can still render to DOM instead of Canvas. Here's Rustact, but with Swift/Swift UI: https://elementary.codes/