๐ฅ Discover this awesome post from Hacker News ๐
๐ **Category**:
๐ **What Youโll Learn**:
A web browser with a rendering engine
written completely from scratch in Zig, paired with
Googleโs V8 for JavaScript. Two years of solo work โ
extremely lightweight, and about 2ร faster than
Chrome in early testing.
No Chromium, no WebKit, no Gecko. The HTML parser, CSS cascade, layout
engine, and paint pipeline are all hand-written in Zig; only the
JavaScript virtual machine is borrowed from Googleโs V8.
The result is a browser small enough to reason about end to end, and fast
enough to beat the mainstream engines on the same hardware.
100โ/โ100
Acid3 conformance
test โ a perfect
score
~2ร
faster than Google
Chrome in early
benchmarking
From scratch
parser, CSS, layout,
paint โ all
hand-written in Zig
2 years
of solo engineering
on the rendering
engine
Acid3 100/100
As of today, cwbrowser passes the Acid3 test with a perfect
100/100 โ the same conformance bar the mainstream
engines cleared, met by a from-scratch engine.
โคย Download โ coming soon

acid3.acidtests.org โ a clean100/100, rendered by its own engine. Note the status bar: full page
loaded and laid out in 2265ย ms.
What it is
cwbrowser is a desktop web browser built on a rendering engine I wrote
from nothing over the last two years. Where Chrome ships Blink, Safari
ships WebKit, and Firefox ships Gecko, cwbrowser ships an engine of its
own: the tokenizer, DOM, CSS parser and cascade, the box-model layout
pass, and the painting stage are all original code in
Zig โ a small, fast, memory-careful systems
language.
The one piece it doesnโt reinvent is the JavaScript engine.
Re-implementing a modern, JIT-compiling JS VM is a decade-scale project,
so cwbrowser embeds Googleโs V8 โ the same
engine inside Chrome and Node โ and wires it to the from-scratch DOM.
You get a real, standards-following browser where the parts that decide
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
descended from code written more than twenty years ago. cwbrowser is a
bet that a browser engine can be rebuilt today โ smaller, faster,
and understandable by one person โ using a modern systems language
and only borrowing the one component (the JS VM) that genuinely
isnโt worth reinventing. Passing Acid3 at 100/100 is the first
proof the approach holds up against real standards.
Download
A public preview build for macOS on Apple Silicon is on the way.
It isnโt posted here yet โ when it is, this is where
itโll live.
โคย Download โ coming soon
๐ฌ **Whatโs your take?**
Share your thoughts in the comments below!
#๏ธโฃ **#cwbrowser #browser #engine #written #scratch #Zig**
๐ **Posted on**: 1785552928
๐ **Want more?** Click here for more info! ๐
