HTML and Compilers

.net, compiler-construction, html, theory

Solution

There is some confusion about, I fear. The fact of the matter is that writing good HTML is easy. Very easy. Writing bad HTML is also very easy, but that's neither here nor there.

What is difficult, I think you'll find, is writing good, cross-browser, beautifully rendered CSS. Very difficult, in fact.

And no amount of abstraction will solve that. Only efforts to improve all browsers will help this; and that is no small feat.

Another issue, and this is a bigger one, is that recently HTML is being abused for things it was never meant for; applications that would benefit greatly from being implemented as "proper" desktop applications are being implemented in HTML and JavaScript because it is "easier" for developers on some level (which, as your post highlights, is a filthy rotten lie).

Compatibility issues cannot be defeated easily; and by implementing things on the wrong "platform" you are setting yourself up to fail. Miserably.

The web is not a platform; it's a tangled weave of danger and despair. And, of course, tubes.

Problem

This question is a more discussion oriented one that a simple problem specific question. Writing basic HTML is simple but writing fast light standards based, SEO best practices complaint, all browsers compatible HTML pages is hard and very time consuming. But why it hard ? In my opinion it hard because of the hundreds of different rules what need to be followed, rules what are hard to remember and even if you remember it hard to merge them together in not contradicting form and the only way to validate you work is by loading it in every browsers you support and validating every scenario. But it really looks like a problem we had in the past in other areas of programming, previously before inventions of high level languages writing program in assembly is looks a lot like writing HTML files, you was forced to remember hundred of different rules for performance, correctness security and so on and the only way to validate them was by executing the program. In other fields this problem was solved by compilers of high level languages what make a syntax simpler, make performance optimizations, check program syntactic correction before execution. Don’t you think we need a different simpler language for writing web pages and compiler what could produce browser specific, standard complaint size optimized HTML from this language ? Do you think it possible to create such languge and compiler ?

Original source