3M+ lines of "from-scratch" code, yet it depends on: - Servo's HTML...

@its_bvisness
Ben Visness@its_bvisness
54 views Jan 16, 2026 ~1 min read
Advertisement
1
3M+ lines of "from-scratch" code, yet it depends on:
- Servo's HTML parser
- Servo's CSS parser
- QuickJS for JS
- selectors for CSS selector matching
- resvg for SVG rendering
- egui, wgpu, and tiny-skia for rendering
- tungstenite for WebSocket support
@mntruell
Michael Truell@mntruell
We built a browser with GPT-5.2 in Cursor. It ran uninterrupted for one week.

It's 3M+ lines of code across thousands of files. The rendering engine is from-scratch in Rust with HTML parsing, CSS cascade, layout, text shaping, paint, and a custom JS VM.

It *kind of* works! It still has issues and is of course very far from Webkit/Chromium parity, but we were astonished that simple websites render quickly and largely correctly.
Media image
2
Also it clearly uses other libraries for layout and text shaping, etc. Not that I begrudge them that (everyone uses Harfbuzz) but it’s absolutely not from scratch.
3
In case anyone was skeptical, there are indeed over 3M lines of Rust before even considering dependencies. With dependencies there are over 9M lines of Rust. (So says cargo-loc, which I fear may be missing some dependencies due to workspace things.)
4
Add Taffy to the list for their flexbox implementation
@leddoo_dev
leddoo@leddoo_dev
@its_bvisness looks like fastrender/src/layout/contexts/flex.rs is a 19532 line taffy wrapper??
Media image
Actions
What You Can Do
  • Export as PDF or Markdown
  • Batch Export to Notion
  • Bookmark & Highlight
  • Screenshot Tweet
Create Free Account

Includes 7-day Premium trial

Advertisement