News for hackers. Stuff that matters.
Re:The Era of the Trident Engine by rapind on Saturday January 25, 2020 @02:07PM (#22147964)
The fact that this software is so complex is the problem imo. The focus at this point should be on cleanup and simplification instead of feature bloat. Every design decision should consider "what can we delete?"
Re:The Era of the Trident Engine by nradov on Saturday January 25, 2020 @02:17PM (#22148025)
Complex software is what customers want. A rendering engine for clean, valid XHTML could be very simple. But everyone wants to be able to see web pages created by technically incompetent designers with "tag soup" HTML. There's no point in complaining, that's just the reality of the modern web.
Re:The Era of the Trident Engine by ripdog on Saturday January 25, 2020 @02:41PM (#22148178)
The complexity in modern browser engines has nothing to do with parsing invalid HTML and everything to do with the vast, absurd feature set of the modern web platform, and the complex interactions between the components.
Re:The Era of the Trident Engine by bobthepanda on Saturday January 25, 2020 @02:59PM (#22148306)
Yeah, if you were to design HTML, CSS, and JS from the ground up today they'd likely look very different.

The bigger issue is backwards compatibility; the web has bent over backwards to maintain it, which is a blessing and a curse. On the one hand it makes the feature set absurd, but on the other hand the web is (relatively) easy to archive since format interpreters for it are widespread, and pages can be built and then forgotten about because they still work.

Re:The Era of the Trident Engine by amelius on Saturday January 25, 2020 @03:35PM (#22148478)
> Yeah, if you were to design HTML, CSS, and JS from the ground up today they'd likely look very different.

I'd like to see that experiment done.

Re:The Era of the Trident Engine by hencoappel on Saturday January 25, 2020 @06:23PM (#22149280)
This is sort of what Flutter claims to be.
Re:The Era of the Trident Engine by rubber_duck on Saturday January 25, 2020 @08:14PM (#22149748)
Flutter is a GUI toolkit, it's a different use case entirely with some small overlap (flutter can run on the web or could be used to build the front-end for a new browser)
Re:The Era of the Trident Engine by bobajeff on Saturday January 25, 2020 @11:30PM (#22150392)
I think he's referring to the fact that Flutter was started as a project, by some of Google's browser and web standards people, to see what the could come up with if they designed a browser from scratch with the knowledge we have today.

This is talked about in a few videos and articles by it's creators.

Re:The Era of the Trident Engine by dodobirdlord on Saturday January 25, 2020 @08:26PM (#22149792)
WASM does seem to be on the road to eventually being a better JS.
Re:The Era of the Trident Engine by mycall on Sunday January 26, 2020 @08:45AM (#22152026)
I wish WASM was AST based instead of stack based architecture.
Re:The Era of the Trident Engine by wokkel on Sunday January 26, 2020 @01:14PM (#22153605)
What does that statement mean? As far as i know stack VS AST is Apple VS. Oranges. If you meant a register based architecture that would make sense. I don't know is wasm code is verifiable, in which case it's trivial to rewrite it to a register like architecture (like dalvik does for jvm bytecode).
Re:The Era of the Trident Engine by Aeolun on Sunday January 26, 2020 @05:44AM (#22151463)
I think we can drop all non-flexbox layout without any degradation in functionality.
Re:The Era of the Trident Engine by emn13 on Sunday January 26, 2020 @03:00PM (#22154351)
You mean grid? I'm suspect you can emulate most if not all of flexbox in grid, but definitely not vice-versa.
Re:The Era of the Trident Engine by acdha on Saturday January 25, 2020 @03:58PM (#22148577)
> A rendering engine for clean, valid XHTML could be very simple. But everyone wants to be able to see web pages created by technically incompetent designers with "tag soup" HTML.

The HTML5 parsing algorithm is not _that_ hard:

https://www.w3.org/TR/2011/WD-html5-20110113/parsing.html

Do you really think that the complexity of a full XML implementation of the half dozen specs required to implement XHTML would really be that significant a savings compared to the actual features browser developers actually spend their time on?

You're correct that complex software is what people want but that's complex as in an advanced document layout system with advanced language support, rich media, forms, etc. rather than the format those features are implemented in.

Re:The Era of the Trident Engine by emn13 on Sunday January 26, 2020 @02:52PM (#22154304)
That algorithm - for what it is, namely pretty basic tree construction - is absurdly complicated. Did you actually read and grok all that stuff about the stack of open elements, and how all kinds of elements have special gotcha clauses? How you can't nest stuff like `<div>`s in `<p>`s, even in descendants - except in those weird corner cases where you can? And let's not forget that the page you linked to is only one of a few pages you need to parse html; stuff like tokenization also has a bunch of weird, legacy modes, and so on. It's pretty crazy; worse than quite a few programming languages, and they have a conceptually much, much more complex domain. Worst perhaps isn't just the sheer size, it's the haphazard inconsistency. If you don't know all the exceptions, it's hard to predict which part will be exceptional.

Seriously, XML is arguably bad, but html5 is absurdly horrible. The only reason it's acceptable is because it's so widely used that parsers are huge shared projects and most bugs are shallow.

I guess it's all a matter of perspective: sure, you might argue, hey, the spec isn't hundreds of pages, so it's humanly comprehensible. But from my perspective that's a really low bar, and it clears it just barely.

It matters too, because these weird quirks have often hidden things like performance issues, misparses, and security issues due to incorrect normalization.

Re:The Era of the Trident Engine by acdha on Sunday January 26, 2020 @04:15PM (#22154847)
Again, it's not like there's no work to implement it but … do you think that's more or less complexity than implementing CSS Grids, text layout systems for complex scripts, building a high-performance JavaScript engine, etc.? The browser teams are not shy about saying when they think changes are important for security, performance, or reliability so I'd consider it an indicator that it's not a huge part of their ongoing efforts.
Re:The Era of the Trident Engine by mycall on Sunday January 26, 2020 @08:57AM (#22152082)
Browser do much more than just HTML5 parsing.

https://en.wikipedia.org/wiki/Comparison_of_lightweight_web_...

Re:The Era of the Trident Engine by acdha on Sunday January 26, 2020 @02:14PM (#22154029)
Yes, that was my point? Even if it was plausible to switch to XHTML, that’s a small and rather insignificant part of browser code bases.
Re:The Era of the Trident Engine by EliRivers on Monday January 27, 2020 @07:44AM (#22158767)
"Complex software is what customers want."

I think I disagree. Most of my customers don't even want software. They want to watch a movie, or read something, or make some data transform, or something else that is their actual goal.

Complex software is what we make in order to enable them to achieve their goal; perhaps if we were smarter and better, we'd be able to make simple software that enabled their goals.

Re:The Era of the Trident Engine by reilly3000 on Saturday January 25, 2020 @11:06PM (#22150331)
Much of the complexity isn’t about HTML rendering, but instead about security and device optimizations.
Re:The Era of the Trident Engine by dredmorbius on Sunday January 26, 2020 @06:51PM (#22155728)
Examples?

Or perhaps more useful: domains / classes of such issues?

I suspect a lot is:

- XHR

- JS generally

- Cookies

A heatmap of problem areas might be interesting.

Update: that's sort of here:

https://www.cvedetails.com/vulnerabilities-by-types.php

Re:The Era of the Trident Engine by reilly3000 on Tuesday January 28, 2020 @02:27AM (#22167187)
I think you hit on the big ones, but also issues around file system access, secure+performant+efficient use of memory across a lot of devices, and complying with an ever-changing landscape of external standards.

Great link!

Re:The Era of the Trident Engine by Vinnl on Sunday January 26, 2020 @04:10AM (#22151201)
That would be incompatible with the mantra 'don't break the web', I'm afraid.