2 ms·
> If you want to allow everyone to write a parser able to parse websites, or allow everyone to be able to write websites, then you have to replace and deprecate
by om2 10y ago
> If you want to allow everyone to write a parser able to parse websites, or allow everyone to be able to write websites, then you have to replace and deprecate parts of the web.
Sounds good in theory. In practice, the opposite is true.
Attempts to define HTML syntax strictly (like DTD-based HTML 4 and earlier, or like XHTML) result in parsers that can't parse websites. But the WHATWG definition of HTML parsing, with its exhaustive and specific attention to handling of error cases, has resulted in HTML parser libraries that are compatible with the actual web. Before that, only browsers could parse real websites as intended and they could only do it through reverse engineering and guesswork.
- kuschku 10y ago> Attempts to define HTML syntax strictly (like DTD-based HTML 4 and earlier, or like XHTML) result in parsers that can't parse websites. That’s a good thing. Because it means websites will be forced to fix their shit, or be broken. Browsers should start with a strict parsing standard, and color the addressbar in a warning red on every page that doesn’t fulfil it. After a year or two, remove support for non-strict parsing piece by piece, until a strict situation is the result. You don’t see WebAssembly parsing everything that’s possible either. And JavaScript parsers trying to make sense of nonsensical content also haven’t been a thing in years. In fact, the exact same thing happens with language all the time: A standards body decides to standardize part of the language, and simplify it, and then new grammatical rules are written, and enforced by law in education, and kids learn the new rules that make everything simpler. A few years later, everyone has adapter – you don’t see anyone using pre-2006 German anymore, either. If we can do it with fucking language, we also can do it with the web.