Live data from Hacker News

We're building a browser when it's supposed to be impossible

awesomekling.substack.com

301–310 of 349 posts

Re: We're building a browser when it's supposed to be impossible

#301
post #272

Earlier quoted context omitted.

I feel like you may have misunderstood what kling is saying. He's not saying "we will cut any corner to get Twitter to load", he's saying "we look at what it would take to get Twitter to load, read through the relevant specs, and try our best to implement the required features cleanly and correctly". Loading Twitter (etc.) is not really the goal, it's more of a prioritisation mechanism for tackling a huge spec. Actua…

No, I understand what Andreas is saying. But the reality is, when you read and implement specs for a specific website, you end up cutting corners, even accidentally. Maybe Twitter relies on a particular behavior of fetch() that was screwed up in Chrome 97 and has had to be kept for backwards compat this entire time. Maybe it uses some CSS that never got properly documented or specified. By targeting a single website,…

Maybe so. Hopefully you’d find that out while looking at the spec for that particular function. If not, you may have to rewrite some code as you learn more. Life goes on

Re: We're building a browser when it's supposed to be impossible

#302

Earlier quoted context omitted.

I have a hard time deciding where in this thread to drop this link, but maybe here is a good spot. Andreas has a video about this topic, and I believe it's this one: https://www.youtube.com/watch?v=vAZvTFoSIFU

Published on April 1st 2022 ;-)

yeah, it's probably the wrong video. Sorry. :( I know it's there though. This question came up and I know there was an answer for it.

Re: We're building a browser when it's supposed to be impossible

#303
post #69

Earlier quoted context omitted.

A few reasons it’s harder to build a browser: - the web is numerous specifications: HTTP, HTML, CSS, JS, SVG. At worst, a regular compiler needs to worry about macros and the language syntax - each of those specifications has numerous versions which, in some cases, can be significantly different from other versions of the same language or protocol. A language compiler generally only focuses on one version of that lan…

A browser rendering engine's output isn't purely graphical, and most things can be tested through other means such as by reading console.log output, looking at the DOM, or looking at computed CSS styles and/or bounding-box information. In fact there's a good reason to keep graphical tests to a minimum: web specs do not dictate things down to the pixel level, so pixels can shift around from version to version, requiri…

The examples you’ve given of the non-graphical elements are describing the easy problems and I was describing the hard problems.

Our two posts aren’t mutually exclusive.

Re: We're building a browser when it's supposed to be impossible

#304
post #272

Earlier quoted context omitted.

I feel like you may have misunderstood what kling is saying. He's not saying "we will cut any corner to get Twitter to load", he's saying "we look at what it would take to get Twitter to load, read through the relevant specs, and try our best to implement the required features cleanly and correctly". Loading Twitter (etc.) is not really the goal, it's more of a prioritisation mechanism for tackling a huge spec. Actua…

No, I understand what Andreas is saying. But the reality is, when you read and implement specs for a specific website, you end up cutting corners, even accidentally. Maybe Twitter relies on a particular behavior of fetch() that was screwed up in Chrome 97 and has had to be kept for backwards compat this entire time. Maybe it uses some CSS that never got properly documented or specified. By targeting a single website,…

It seems that GP already addressed your concern: "read through the relevant specs, and try our best to implement the required features cleanly and correctly"

Of course some errors will be made along the way. That's to be expected, regardless of the approach taken.

Re: We're building a browser when it's supposed to be impossible

#305
post #241

Earlier quoted context omitted.

Any language that enforces memory safety is unlikely to crash because of a segmentation fault.

They will instead crash because of an uncaught exception or a panic handler - end result is the same.

By removing segmentation fault crash you have removed a large portion of unwanted crashes, the end result is very different.

Re: We're building a browser when it's supposed to be impossible

#306

I absolutely love that Andreas Kling doesn't care about it being hard/impossible, and just dives straight in with pure optimism. It's absolutely wonderful to see the joy and positivity.

There’s also the matter of him having worked on browsers before, so he’s not exactly flying blind.

Ah, that helps, I did not know that. I love the optimism regardless.

Re: We're building a browser when it's supposed to be impossible

#307
post #305

Earlier quoted context omitted.

They will instead crash because of an uncaught exception or a panic handler - end result is the same.

By removing segmentation fault crash you have removed a large portion of unwanted crashes, the end result is very different.

But the crashes doesn't get removed, they get transformed into error types or exceptions and you still crash when you don't handle them.

Re: We're building a browser when it's supposed to be impossible

#308
post #305

Earlier quoted context omitted.

By removing segmentation fault crash you have removed a large portion of unwanted crashes, the end result is very different.

But the crashes doesn't get removed, they get transformed into error types or exceptions and you still crash when you don't handle them.

This is only true if the language does not employ static analysis.

Re: We're building a browser when it's supposed to be impossible

#309

> So instead of [building the browser one feature/spec at a time], we tend to focus on building “vertical slices” of functionality. This means setting practical, cross-cutting goals, such as “let’s get twitter.com/awesomekling to load”, “let’s get login working on discord.com”, and other similar objectives. Seems similar to how Wine is developed: instead of just going down the list of API functions to implement, the…

>Console emulators (especially of the HLE variety) seem to have a similar flow. And emulators that have gone this path have all regretted it, because they end up making hacks to make work, because everyone simply wants to play . Dolphin is still paying the price of that method years down the line. Project64 took years to unfuck themselves up, ZSNES is forgotten and overtaken by many more that have done the proper thi…

> ZSNES is forgotten and overtaken by many more that have done the proper thing.

When ZSNES did its thing, which, just to remind people, was back when Pentium IIs ruled the roost and CPUs topped out at 450mhz, doing things the proper way was not a choice because the proper way needed 3x the CPU power of doing things the ZSNES way that worked.

Dolphin became popular because it could actually play games, and I bet if they had instead spent an extra 3 or 4 years working on code that was "correct" without releasing anything, well odds are they wouldn't have such a large following and would not have attracted so many contributors.

Users do not benefit from "perfect code" that they never get to use because it is still in development.

Re: We're building a browser when it's supposed to be impossible

#310
post #263

Earlier quoted context omitted.

Uh, no. It's a bad proxy, for the reasons just stated. As the spec gets more detailed, it gets easier to implement, not harder.

A more detailed spec might have more concrete definitions but it also means more actual code for someone to write. An under-detailed spec you might have a case switch with a couple defined values and an undefined catch all. A super detailed spec just adds case statements and requires more code to handle them. The detail in the spec makes for lower cognitive load but the code still needs to be written and ideally test…

> A more detailed spec [...] means more actual code for someone to write.

No, it doesn't. A detailed spec has the same amount of code to write as a spec for the same thing with less detail; for the types of specs relevant to this discussion, the primary requirement of "does what the other browsers do" exists whether the details are made explicit in the spec or not. More code is a consequence of an increase in requirements, not detail.

In any case, neither circumstance is I/O bound to begin with.

Post reply on HN