Live data from Hacker News

Rethinking DOM from first principles

acko.net

31–40 of 234 posts

Re: Rethinking DOM from first principles

#31

Good article. It kind of makes me question how long we can go down this path though. Like surely we can't keep adding to css and the dom api's for 20 more years? How much bloat will we accumulate before we start over? I hate to say it, but perhaps the browser needs a completely new standard designed for shipping applications? Something akin to what's discussed in the article - a simple but robust layout system built…

> I hate to say it, but perhaps the browser needs a completely new standard designed for shipping applications?

In all seriousness, isnt this what Java is for? Why would you need to treat a web browser like a virtual machine?

Re: Rethinking DOM from first principles

#32
post #12

Earlier quoted context omitted.

That's because you're looking at it from the perspective of what the developers of those news websites want, rather than what the users of those news websites want. The users want to get a document , not an app. That's what the web was made for, documents.

The users want to read an article, I'm not sure the average user really cares if it's delivered as a document or an app

The user minds when the app gets in the way of the document.

Re: Rethinking DOM from first principles

#33

It is clear that we need both apps and documents in web browsers. Yes yes "web", "hateoas" and all that, but it didn't materalise in practice and is therefore irrelevant. So maybe we can have , which lets you use a new set of APIs focussed on applications, but is otherwise in the same "shape". JSX type syntax. This way it's easy for say newspapers to offer both an app format as well as a "lite" document format. Inste…

or maybe just stop trying to force the round peg in a square hole. an application is surely not a document. they open documents. its conceptual, but it would make your life so much easier if you stopped trying to make a fully fledged platform out of what was essentially a rich text document viewer. java has since come along and given you pretty much write once, run anywhere and close to instant deployment with its ap…

Web as a deployment platform has too many advantages for it to be ignored for distributing _anything_.

We don't have to force a round peg into the square hole . Let's make a new round hole but keep using the amazing deployment platform.

Re: Rethinking DOM from first principles

#34

Uggghhh, the article states correct facts about the DOM but grossly incorrect conclusions. Most developers have always feared working with the DOM. This irrationality is not new. I have no idea why, but tree models scare the shit out of college educated developers. That’s supremely weird because computer science education spends so much energy on data structures and tree models. It also makes the conversation about W…

The reason working with the DOM directly is hard is that you have to implement arbitrary patching to go from one state to another.

The entire point of frameworks like React is to avoid the problem, by automatically creating and applying the patch for you.

It's not irrational; quite the contrary.

Re: Rethinking DOM from first principles

#35

Uggghhh, the article states correct facts about the DOM but grossly incorrect conclusions. Most developers have always feared working with the DOM. This irrationality is not new. I have no idea why, but tree models scare the shit out of college educated developers. That’s supremely weird because computer science education spends so much energy on data structures and tree models. It also makes the conversation about W…

I closed my web dev business just three years ago. I found that many people who work with the web don't want to do the work to understand how it all works. They think there must be a library somewhere to do "that" while doing "that" is simple enough using standard components and features.

Another issue is people basing their fears of things in the past. Yes, the web was more difficult to do fancy things but often they're trying to push the web to do things it just couldn't do back then. Now you can using basic, built-in functionality and it's often easier that way.

Re: Rethinking DOM from first principles

#36

What needs to happen is that HTML needs to go back to being a mark-up language, and the web needs to stop trying to deliver an application-level implementation for every single website. And we need to stop relying on JS so much.

Every big tech company is too afraid to fundamentally rewrite the front-end of the internet even though they’ve all produced wonderful alternatives to varying degrees (TypeScript, Dart, Silverlight, etc). Most likely because they don’t want to be targeted as antitrust like MS back in the day.

Re: Rethinking DOM from first principles

#38
I'm tempted to take the opposite stance to the author. The web as a platform is wildly successful, and it's interesting to think about why.

Surely the "loose" standards encouraged neat hacks that at some point were encoded as best practices and then standardized. Maybe that would tempt us to want to "cut the cruft" but a) people probably thought that many times previously and b) backwards compatibility is probably more valuable than one would think.

Re: Rethinking DOM from first principles

#39
post #7

What needs to happen is that HTML needs to go back to being a mark-up language, and the web needs to stop trying to deliver an application-level implementation for every single website. And we need to stop relying on JS so much.

This view is completely backwards and I'm baffled by its popularity. Given that even newspaper websites are now built as applications, we should accept that the web is an application platform (with one of those applications being displaying articles) and rework HTML as an application display language. And we need to start relying on JS more. (Specifically, we should reimplement most traditional HTML elements and CSS…

> This view is completely backwards and I'm baffled by its popularity.

It's a completely valid view, and none of it is backwards.

What's backwards is trying to bend a system barely capable of displaying static content to create apps.

Re: Rethinking DOM from first principles

#40

Uggghhh, the article states correct facts about the DOM but grossly incorrect conclusions. Most developers have always feared working with the DOM. This irrationality is not new. I have no idea why, but tree models scare the shit out of college educated developers. That’s supremely weird because computer science education spends so much energy on data structures and tree models. It also makes the conversation about W…

The reason WASM does not have dom access is that many recent DOM APIs return and expect javascript objects and classes like iterators, so you would still need some thin js glue wrapper between the dom and wasm. Security has nothing to do with it as (performace aside) wasm+minimal js glue can already do anything js can do
Post reply on HN