TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

So you want to build a browser engine

225 pointsby zmodem12 months ago

17 comments

esprehn12 months ago
Engine diversity is really important for the ecosystem and continued innovation. While building something competitive with the big three engines is a monumental task there&#x27;s still a lot of value in building alternative engines to try new ideas even if getting &quot;the whole web&quot; implemented is basically impossible.<p>For example:<p>- Servo vs Blink vs Cobalt do selector matching and style resolution very differently.<p>- WebKit has a selector JIT, no one else does though.<p>- WebKit and Blink do layout super differently (with LayoutNG shipped).<p>- Firefox&#x27;s html parser is written in Java and converted to C++ at build time.<p>The big value in folks trying to write new engines is finding these alternate paths. We can&#x27;t depend on the big three for all the innovation.<p>That&#x27;s what&#x27;s great about Ladybird. Sure it&#x27;ll need a lot of sophisticated sandbox improvements to get us to a big four situation, but it&#x27;s more likely its value will be in finding another road the other engines didn&#x27;t travel across the huge universe of specs, content and features.
评论 #40632427 未加载
评论 #40631121 未加载
评论 #40630690 未加载
shiomiru12 months ago
I&#x27;m writing one for fun: <a href="https:&#x2F;&#x2F;sr.ht&#x2F;~bptato&#x2F;chawan&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sr.ht&#x2F;~bptato&#x2F;chawan&#x2F;</a><p>&quot;Fixed-width text to a grid&quot; makes things easier (sometimes), but I think it still qualifies.<p>On the article itself; it might be better to start with more... basic things than the optimizations it talks about:<p>* Cascading &amp; layout must be cached and optimized - far from trivial. Layout is one of the hardest parts to get right at all, to make it fast as well is another level... and I&#x27;m just talking caching, not even multi-threading.<p>* The &quot;web platform&quot; contains a very large amount of poorly thought out features harmful for user privacy and&#x2F;or security. You can choose between convenience (opt out) and privacy (opt in), or try to balance the two as major browsers do. Both is often impossible.<p>* &quot;Serialize the entire application state&quot; sounds like the most complex thing you can come up with as a distinguishing feature. Much more low hanging fruit exists if you give up on writing a Chromium clone. e.g. a fun side project I&#x27;ve had is making my browser &quot;protocol-agnostic&quot;, or adding a bunch small QOL stuff for myself. You can probably find new ideas easily once you start out.<p>* Older browsers are useful for inspiration too. The coolest features in mine are often just carbon copies of the same things from w3m, just a bit more polished. Reading about what historical engines did - even IE! - is often enlightening too. Sometimes it&#x27;s just a smaller scale of what engines do now, and easier to implement. Other times it&#x27;s a whole different approach.<p>* It&#x27;s easy to get lost in the details - careful with perfectionism. As you start getting more components interacting, it will slowly become clear when the naive approach is wrong and how to improve it.<p>Overall, it takes time, but is also fun and rewarding - you will learn a lot, even without replacing Chromium.[0] That said, if you want to learn how &quot;modern&quot; browsers work, getting involved with a &quot;modern&quot; engine itself is probably much more productive.<p>[0]: To write a Chromium replacement, you may have to reincarnate as awesomekling ;)
评论 #40627951 未加载
评论 #40627836 未加载
pizlonator12 months ago
I’m not sure that performance needs to constrain web engine design the way it traditionally has. The world has changed since the browser perf war started.<p>Just try disabling the JIT in a modern browser and you’ll find your UX is not really any worse.<p>HW has gotten faster than when the current browser perf wars kicked off. So it might be that to have a meaningfully useful browser engine alternative, perf won’t be the top concern. Compatibility will though, just because of the sheer number of features a modern browser engine supports.<p>And if you don’t have JIT, then it’s not clear if Spectre is even a meaningful concern.
评论 #40630948 未加载
amelius12 months ago
This makes writing a compiler or writing an OS kernel look like child&#x27;s play.
评论 #40632262 未加载
评论 #40627526 未加载
评论 #40627121 未加载
评论 #40628024 未加载
bdahz12 months ago
Does anyone have the idea of escaping from HTML&#x2F;CSS? As these specs are too complicated and not friendly for web developers as well. Maybe we could re-invent a browser engine without conforming to HTML&#x2F;CSS specs?<p>An (early) alternative spec&#x2F;engine would be a Figma-compatible vector graphics spec[2] and its rendering engine[3]. It is called VeryGoodGraphics[1].<p>[1] <a href="https:&#x2F;&#x2F;verygoodgraphics.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;verygoodgraphics.com&#x2F;</a>, the website is built with its own technology (wasm version).<p>[2] <a href="https:&#x2F;&#x2F;docs.verygoodgraphics.com&#x2F;specs&#x2F;overview" rel="nofollow">https:&#x2F;&#x2F;docs.verygoodgraphics.com&#x2F;specs&#x2F;overview</a><p>[3] <a href="https:&#x2F;&#x2F;github.com&#x2F;verygoodgraphics&#x2F;vgg_runtime">https:&#x2F;&#x2F;github.com&#x2F;verygoodgraphics&#x2F;vgg_runtime</a>
评论 #40634377 未加载
评论 #40636171 未加载
评论 #40634413 未加载
评论 #40637430 未加载
评论 #40749455 未加载
评论 #40636241 未加载
评论 #40634124 未加载
djbusby12 months ago
Seems a good place to mention <a href="https:&#x2F;&#x2F;sciter.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;sciter.com&#x2F;</a><p>It&#x27;s been on HN loads of times.<p>A &quot;browser&quot; engine but very narrow scope. Works a treat for LOB type apps.
评论 #40628121 未加载
phendrenad212 months ago
This post starts with a false dichotomy: You&#x27;re either making a toy browser for fun, or you&#x27;re trying to make the next Chrome. There are many points in-between on that spectrum. (Look how long Microsoft IE existed, despite being highly inferior.)
评论 #40627722 未加载
评论 #40627687 未加载
评论 #40632581 未加载
ilrwbwrkhv12 months ago
If you actually want to build one I cannot recommend <a href="https:&#x2F;&#x2F;browser.engineering&#x2F;" rel="nofollow">https:&#x2F;&#x2F;browser.engineering&#x2F;</a> enough.
bobajeff12 months ago
I&#x27;ve wanted to make my own browser by forking chromium. But then I got confronted with the reality of hacking on a Google scale c++ project.<p>I&#x27;ve tried doing it by embedding webkit which is much more doable but I&#x27;ve found that many sites I use don&#x27;t work my embedded webkit.<p>So now I think if I want to make my own browser it would be better start making my own versions of those sites first and make sure those are good and popular. At which point I&#x27;ll just make native clients for them and forget about html&#x2F;js&#x2F;css.
cbxyp12 months ago
interesting how oldpersonintx&#x27;s comment &quot;thinly-veiled passive-aggressive swipe at Ladybird&quot; was dead&#x27;d here when that accurately reflects the authors comments (as roc-robert o&#x27;callahan) here on LWN.net: <a href="https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;977625&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lwn.net&#x2F;Articles&#x2F;977625&#x2F;</a>
评论 #40633271 未加载
ZeroGravitas12 months ago
I was going to suggest:<p>&gt; initially try just being a faster, lighter or lower-power Electron or WebView.<p>But he mentioned it himself, though maybe someone might want to try this with no intention to become a full browser. Can you skip any of the tricky security requirements if it&#x27;ll be bundled into an app? Or is that just asking for trouble?
评论 #40627783 未加载
评论 #40627226 未加载
评论 #40627097 未加载
评论 #40627023 未加载
评论 #40627471 未加载
9cb14c1ec012 months ago
How important is process separation if the browser engine is programmed with a memory safe language like Rust? I am under the impression that things like site separation are to bandage memory safety issues. Is that right, or are there other issues at play?
评论 #40632137 未加载
atum4712 months ago
I honestly think (I&#x27;ve been thinking about that for a few years now) that eventually a OS will be nothing more than a browser.
评论 #40627692 未加载
评论 #40627834 未加载
purple-leafy12 months ago
Great read :)
skilled12 months ago
Who is this post intended for?<p>Nobody builds their own browser engines. And I mean nobody. I didn’t get the feeling that he wrote this for pet projects either.<p>Andreas over at Ladybird is probably the only one (and Servo?) who is really doing it the way that this post describes.<p>Still, the last couple of paragraphs made me think that this is more of a reflection of his own time over at Mozilla: could have &#x2F; would have.
评论 #40627813 未加载
评论 #40627206 未加载
评论 #40627654 未加载
评论 #40627196 未加载
评论 #40627437 未加载
评论 #40627484 未加载
评论 #40627677 未加载
评论 #40630250 未加载
评论 #40627176 未加载
account4212 months ago
&gt; So You Want To Build A Browser Engine<p>&gt; [bunch of things that are only relevant to an application platform]<p>Yeah you really don&#x27;t need any of this for a <i>web browser</i> to be usable for its intended purpose.
评论 #40637706 未加载
crazygringo12 months ago
&gt; <i>So You Want To Build A Browser Engine</i><p>The only correct answer is, &quot;don&#x27;t&quot;.<p>I mean, if you want to build a toy browser engine for a CS class or fun or something, then sure.<p>But the idea that &quot;you want to build an engine that’s competitive with Chromium&quot; is, quite simply, nonsensical.<p>If you want your own browser engine, you&#x27;re going to fork Chromium or Gecko (Firefox). I mean, even <i>Microsoft</i> gave up on maintaining its own independent engine and switched to Chromium.<p>I literally don&#x27;t understand who the author thinks this post is supposed to be addressed to.<p>Building an independent browser engine could have made sense in 1998. These days it would cost hundreds of millions of dollars in dev time to catch up to existing engines... just to duplicate something that you already have <i>two</i> open-source versions of?
评论 #40631566 未加载
评论 #40628757 未加载