Hacker News new | ask | show | jobs
by baroomba 2330 days ago
I’m pretty sure CSS, JavaScript, and the way both interact with each other and with HTML are the main reasons writing a useful browser engine is rapidly becoming impossible—and we’ll end up replacing it with Wasm rendering to a canvas for most things while not cleaning up HTML to be something simpler and delightfully less-capable, sadly. I think you could significantly increase the richness of just HTML without making it, per se, 1/10 the challenge of implementing all of those together.
1 comments

The interactions between JS, CSS and HTML are not the main problem. The main problems are:

Feature interaction complexity between CSS features is a huge problem. Some of that could have been avoided if CSS had been designed differently, but some of it seems unavoidable (e.g. laying out text with mixed directions, mixed writing modes, ruby, font substitution, modern font features, etc etc --- at speed --- is just really complex).

Modern high-performance JS is really complicated to implement.

The plethora of APIs exposed to JS --- WebXYZ --- is incredibly complicated.

HTML is pretty complicated, e.g. HTML forms.

But if you take away JS, CSS/HTML don't get a whole lot easier, assuming you're still supporting interaction in some way. I mean, for your proposed map API, if the user can manipulate the functionality and you have lots of features that can be customized declaratively, it's not much more complicated to expose those controls to JS.

If you can simplify the problem so that CSS and HTML don't need to support incremental relayout/DOM changes, that would help a lot, but removing JS isn't enough for that. Things like zooming, window resizing, incremental loading, and any kind of editing put a lot of the same requirements on the engine.