cwbrowser — a browser engine written from scratch in Zig
cwbrowser
A web browser with a rendering engine<br>written completely from scratch in Zig , paired with<br>Google’s V8 for JavaScript. Two years of solo work —<br>extremely lightweight, and about 2× faster than<br>Chrome in early testing.
No Chromium, no WebKit, no Gecko. The HTML parser, CSS cascade, layout<br>engine, and paint pipeline are all hand-written in Zig; only the<br>JavaScript virtual machine is borrowed from Google’s V8.<br>The result is a browser small enough to reason about end to end, and fast<br>enough to beat the mainstream engines on the same hardware.
100 / 100
Acid3 conformance<br>test — a perfect<br>score
~2×
faster than Google<br>Chrome in early<br>benchmarking
From scratch
parser, CSS, layout,<br>paint — all<br>hand-written in Zig
2 years
of solo engineering<br>on the rendering<br>engine
Acid3 100/100
As of today, cwbrowser passes the Acid3 test with a perfect<br>100/100 — the same conformance bar the mainstream<br>engines cleared, met by a from-scratch engine.
⤓ Download — coming soon
macOS · Apple Silicon
A public build is being prepared. Want to be told when it lands?<br>Email me<br>and I’ll send you the link.
cwbrowser on acid3.acidtests.org — a clean<br>100/100, rendered by its own engine. Note the status bar: full page<br>loaded and laid out in 2265 ms.
What it is
cwbrowser is a desktop web browser built on a rendering engine I wrote<br>from nothing over the last two years. Where Chrome ships Blink, Safari<br>ships WebKit, and Firefox ships Gecko, cwbrowser ships an engine of its<br>own: the tokenizer, DOM, CSS parser and cascade, the box-model layout<br>pass, and the painting stage are all original code in<br>Zig — a small, fast, memory-careful systems<br>language.
The one piece it doesn’t reinvent is the JavaScript engine.<br>Re-implementing a modern, JIT-compiling JS VM is a decade-scale project,<br>so cwbrowser embeds Google’s V8 — the same<br>engine inside Chrome and Node — and wires it to the from-scratch DOM.<br>You get a real, standards-following browser where the parts that decide<br>how the web looks are entirely hand-built.
How it’s built
LanguageZig for the whole rendering engine — manual memory management, no garbage collector, no hidden runtime.
HTML & DOMA from-scratch tokenizer and tree builder producing a live DOM the engine and V8 both operate on.
CSSOriginal parser and cascade — selectors, specificity, inheritance, the box model — feeding the layout pass.
Layout & paintHand-written block/inline layout and a paint pipeline that renders pixel-for-pixel to match the Acid3 reference.
JavaScriptGoogle’s V8, embedded and bound to the DOM — the same VM that powers Chrome and Node.
PerformanceRoughly 2× Chrome on the same machine in early tests; the whole engine is lightweight by design.
Why build a browser from scratch?
The modern web runs on three rendering engines, all enormous, and all<br>descended from code written more than twenty years ago. cwbrowser is a<br>bet that a browser engine can be rebuilt today — smaller, faster,<br>and understandable by one person — using a modern systems language<br>and only borrowing the one component (the JS VM) that genuinely<br>isn’t worth reinventing. Passing Acid3 at 100/100 is the first<br>proof the approach holds up against real standards.
Download
A public preview build for macOS on Apple Silicon is on the way.<br>It isn’t posted here yet — when it is, this is where<br>it’ll live.
⤓ Download — coming soon
macOS · Apple Silicon
Email haojng@gmail.com<br>to be notified when the beta is available.