Live data from Hacker News

So you want to build a browser engine

robert.ocallahan.org

121–130 of 134 posts

Re: So you want to build a browser engine

#121
post #92

Does anyone have the idea of escaping from HTML/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/CSS specs? An (early) alternative spec/engine would be a Figma-compatible vector graphics spec[2] and its rendering engine[3]. It is called VeryGoodGraphics[1]. [1] https://verygoodgraphics.com/ , the website is built…

My opinion is that the rendering engine should be WASM specified in a header. This way the site provider can choose whatever engine they want, including possibly not even using HTML.

Re: So you want to build a browser engine

#122

Earlier quoted context omitted.

Yeah - there really is a opportunity now to rethink browsers as just sandboxed rendering windows using WebAssembly + WebGPU. Could still have typical DOM rendering handled with Webassembly delivered by the web sites (ideally cached). The challenge is though still having standards and accessibility options. That VeryGoodGraphics example allows for no text selection - and doesn't at all handle zooming. Still though it'…

How would ad blocking work in this world? A browser without ad blocking is useless.

How would ads work in this world? The advertising ecosystem relies on adding a 1-2 line JavaScript blurb to the page, and then the ads are added at display time.

Re: So you want to build a browser engine

#123
post #76

Earlier quoted context omitted.

But that's exactly my point. This article appears to be entirely about an implementation from scratch. It makes very clear that it is not about forking Chromium. But even Google was smart enough not to start from scratch. So again, I don't know who the intended audience for this article is. It's advice on something no sane person or organization would ever do.

And yet a few people are doing it. So yeah, it's advice to insane people.

I have succumbed to the temptation to implement various aspects of this. I have also tweaked existing implementations for my day job. I even had the assignment to pitch an implementation to a client. So I am sure that some would question my sanity NOW. TFA suggests that I might not have been sane to start with.

I admire any team-of-one that takes on this endeavor and publishes their work.

Re: So you want to build a browser engine

#124

Earlier quoted context omitted.

"- Firefox's html parser is written in Java and converted to C++ at build time." This is surprising. Is it really true in the sense that the code that parses the HTML in a regular Firefox install was autoconverted when it was built?

Yep: https://searchfox.org/mozilla-central/source/parser/html/jav... And more info: https://about.validator.nu/htmlparser/

Huh, I was curious about how that was done, and it looks like it's a specialized Java to C++ converter: https://github.com/validator/htmlparser/blob/master/translat....

Looking at the source, it seems pretty easy to find Java programs that wouldn't compile correctly, but of course a fully general Java to C++ converter would be a huge undertaking. I guess with OK test coverage of the generated C++ code (which Firefox certainly has), editing the Java code remains doable.

Re: So you want to build a browser engine

#125

Earlier quoted context omitted.

> Look at what happened when Microsoft eventually tried to catch up with Chrome - they gave up. That wasn't because they weren't up to the job. It's because Google was using Microsoft's playbook against them. https://news.ycombinator.com/item?id=18697824 > I very recently worked on the Edge team, and one of the reasons we decided to end EdgeHTML was because Google kept making changes to its sites that broke other bro…

YouTube did this to Firefox too - for a while they were serving a special degraded version of YT to Firefox users (polyfilled web components, instead of native web components or their classic non-web-components version) even though they had versions that would perform better. "Oops". If you used user-agent tricks you could get them to serve a good version.

Now I wonder if this is a thing that still exists, and I wonder if I should be spoofing my user-agent to Chrome just as a general rule in Firefox.

Re: So you want to build a browser engine

#126
post #78

Earlier quoted context omitted.

It's not really clear what this even means. HTML5 and CSS3 aren't new versions of HTML and CSS that obsolete the prior stuff; they are extensions to what already existed. So, for example, as far as I know, every web browser uses the HTML5 parsing algorithm for parsing HTML. This algorithm is very complicated, because it describes what parse tree to produce for any possible document. There's not, like, a separate HTML…

It's a semi-noob illusion that focusing only on modern standards and practices would surely result in a leaner implementation. This goes all the way back to the big push for web standards in 1998—e.g. you can find Slashdot Q&As from the early 2000s where people bring up the idea of how much smaller the browser could be without quirks mode and IE compatibility and then get corrected about how much of the code base thi…

The Ladybird folks frequently claim that directly implementing the modern versions of standards is a huge benefit.

Re: So you want to build a browser engine

#127
post #81

Earlier quoted context omitted.

> used by nearly every human on earth Roughly 60% of earth's population used the internet in 2023. So not quite nearly every human .

If we exclude over 75 with no interest in using it (and no use case for it in their environmnent/culture), and under 10, we're pretty close to covering all the rest. And even the 60% is some hand wavy estimate about internet reach, about people using the internet frequently. More people use the internet than that, some transparently through some smartphone app or basic feature phone, which almost everybody has even i…

I think "nearly every human" is a bit more hand wavy than the 60% statistic.

Re: So you want to build a browser engine

#128
post #44

Earlier quoted context omitted.

> used by nearly every human on earth Roughly 60% of earth's population used the internet in 2023. So not quite nearly every human .

25% of the Earth's population is younger than 15. Assuming 20% of them use the internet, the TAM (not including the 3 out of 4, or 75%, seems like nearly ever human, I'd say (though it is a matter of opinion I guess.)

Indeed it is a matter of opinion.

Much like the cliché "the internet is the sum of all human knowledge".

If you have deep specialist knowledge in a field that has existed for more than thirty years it can become quite obvious that the internet really in is nowhere near "the sum" of our knowledge.

Re: So you want to build a browser engine

#129

Earlier quoted context omitted.

YouTube did this to Firefox too - for a while they were serving a special degraded version of YT to Firefox users (polyfilled web components, instead of native web components or their classic non-web-components version) even though they had versions that would perform better. "Oops". If you used user-agent tricks you could get them to serve a good version.

Now I wonder if this is a thing that still exists, and I wonder if I should be spoofing my user-agent to Chrome just as a general rule in Firefox.

It was fixed years ago, though it's possible they still do similar things in other scenarios.

UA spoofing in firefox will get you blocked by recaptcha and cloudflare.

Re: So you want to build a browser engine

#130
post #92

Does anyone have the idea of escaping from HTML/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/CSS specs? An (early) alternative spec/engine would be a Figma-compatible vector graphics spec[2] and its rendering engine[3]. It is called VeryGoodGraphics[1]. [1] https://verygoodgraphics.com/ , the website is built…

Lock Casey Muratori in a room until he designs the right API? He definitely believes the current one is the wrong API :-)
Post reply on HN