logoalt Hacker News

Sharlinyesterday at 7:56 PM3 repliesview on HN

To be fair, it easily takes 3 million lines of code to make a browser from scratch. Firefox and Chrome both have around ten times that(!) – presumably including tests etc. But if the browser is in large part third-party libraries glued together, that definitely shouldn't take 3 million lines.


Replies

mghackerladyyesterday at 8:43 PM

Depending on how functional you want the browser to be. I can technically write a web browser in a few lines of perl but you wouldn't get any styling, let alone javascript. Plus 90% of the code is likely going to fixing compatibility issues with poorly designed sites.

jamesfinlaysontoday at 1:39 AM

Yeah I would have thought 3 million lines for a fully functional browser is a little lean, though I imagine that Chrome and Firefox have probably reinvented some STL stuff over the years (for performance) which would bulk it out.

simonwyesterday at 8:37 PM

FastRender isn't "in large part third-party libraries glued together". The only dependency that fits that bill in my opinion is Taffy for CSS grid and flexbox layout.

The rest is stuff like HarfBuzz for font rendering which is an entirely cromulent dependency for a project like this.