← Back to context

Comment by chankstein38

6 hours ago

That's what got me. I've never written a browser from scratch but just telling me that it took millions of lines of code made me feel like something was wrong. Maybe somehow that's what it takes? But I've worked in massive monorepos that didn't have 3million lines of code and were able to facilitate an entire business's function.

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.

  • 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.

  • 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.

  • 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.