Hacker News new | ask | show | jobs
by austin-cheney 747 days ago
I am considering writing a new approach to the concept of a Document Object Model (DOM) in Rust. The DOM is the compile target of the web browser.

I have not started this work yet and may not but I have already thought through the architecture of how it would work, something more refined than this plan:

* Layer 0: Node relationships and access methods.

* Layer 1: Syntax, allow definitions for any scheme like JSON. YAML, XML, markdown.

* Layer 2: Grammar, allow definitions for any static data language like HTML, SVG, TypeScript interfaces/types, XML instance languages.

* Layer 3: Schema, any implementation should have the means to validate any instance of a grammar and then self determine how to handle invalid parts.

The current DOM implementation is both too restrictive in its definitions and yet far too complicated in its implementation. If it were drastically simplified there would present much greater opportunities for scale at much lower costs than currently available. We have 30 years of history and lessons learned, which is exciting.

Key considerations:

* Simple is not easy. This would be designed around concepts of few and a rigid purposeful structure. If the current DOM scares you this should scare you more and easy will never become a determinant.

* Don’t be smart. XML and its supporting technologies were brilliant and powerful, so much so that nobody outside of senior data scientists really made use of it in any meaningful way. This new approach would have a model to allow for scale but the model would be primitive. Let the instances be brilliant and the model both boring and small.