> Compilation errors are really non-helpful. In programming, if I omit one side of a bracket or parentheses somewhere, I'll almost certainly get an error with a reference to the line number right at or below the issue. GOOD LUCK finding a missing bracket in a LaTeX document based on the error messages when compilation fails.
You are right but I think is not trivial to solve because contrary to programming languages LaTeX is interleaved with natural language and so almost everything is possible. Maybe the best approximation is to have heuristics. For example start with a valid document, introduce errors and train a neural network to identify the problem. Overkill?
While we're already using machine learning and neural networks to solve this problem, why not use a blockchain? /s
TeX being "interleaved with natural language" is not at all at the heart of the problem IMO. Every HTML document does so, too. The real problem lies much deeper. TeX uses recursive rewrites of the code that is the document to achieve what it does, without properly keeping track of where it is and what it does. There is no technical necessity for doing so, but the technique introduces huge complexity costs. On a somewhat related note, TeX's syntax at its very heart is also not trivial to parse short of executing (compiling) a given document (i.e. TeX's syntax itself is Turing-complete). This has been done only because the author got carried away by the coolness factor of it. Already a few years after TeX came out, Leslie Lamport implemented LaTeX on top of TeX to make TeX more approachable to less dedicated / insanely gifted users; he chose to dial back on this very aspect—the inscrutable syntax—and proposed a much more regular syntax as a convention.
Tex being Turing complete is what allowed LaTeX in the first place. HTML not being Turing complete requires Javascript and CSS separately. Do you find them easier? Maybe, I'm not sure, but you cannot escape your language being Turing complete because the range of possible documents is so vast.
This doesn't sound right. First of all, I'm not complaining about TeX being Turing-complete, what I'm saying is the syntax is unnecessarily hairy because TeX's syntax is Turing complete, meaning there is no static grammar production that would allow you to recognize all the macros / commands / 'active' content parts in a given document—you have to typeset (compile) it, only then you can know. Nothing is gained by this, not in theory and not in practice; it's just a burden.
To say that "HTML is not Turing-complete, therefore CSS as a separate language is required" is not even wrong and I leave it to the readers to fill out the blanks.
To say that "HTML is not Turing-complete, therefore JavaScript as a separate language is required" is more or less correct although to be fair we've seen many, many features such as animation being absorbed by declarative CSS that had to be implemented in imperative JS so in that regard the need for JS has diminished.
I can say with certainty that a full fledged programming language (i.e. Turing-completeness + usability) is absolutely necessary for a viable solution of document production. And while one can and people do produce TeX and HTML output programmatically, this does not obviate the need for a typesetting engine that can tell you where you are and what the circumstances are while typesetting the document. JavaScript has grown many abilities in this direction, but TeX in comparison is, after almost 45 years in development, still lacking and CLUMSY AS HELL for crying out loud.
Nothing is easy, simple or straightforward in TeX. Numbers are difficult, units are difficult, command syntax is difficult, namespaces are difficult (because there are none), variable names are difficult, conditions are difficult (there are like hundreds of specialized \if s), knowing in which column you are is difficult, fonts are difficult, character encoding is difficult, keeping constant line heights is difficult, positioning floats is difficult, the processing model is difficult, the very syntax is difficult.
I've said it before and I will say it again: TeX is a computational typesetting system, but it turns out it's quite bad at dealing with numbers, strings, and conditions, the basic building blocks of computational typesetting.
TeX is an utterly broken system because every single aspect is a convoluted mess.
It does get a lot of praise for its incorporation of the Knuth-Plass line breaking algorithm, and rightly so. However this beast, too, is hard to handle unless you just go with the defaults. It will happily give you overshooting lines because Knuth decided to have a word jutting out the right margin was a better solution than unsightly spaced words or letters. Most printers would disagree and just bite that bullet where necessary.
Yes, TeX will issue a warning in such cases but this is almost insubstantial because TeX keeps warning you about many, many things in the same output stream as its informative messages. That stream is almost impossible to parse for humans and machines alike. To make it even harder TeX's console output is hardwired to wrap at column 80. Even TeX's error messages are a convoluted mess.
/rant
And to come back to your original question, yes, I do have the strong suspicion that the separation of styling (CSS), content (HTML) and programming proper (JS) into three distinct compartments with differing syntaxes is close to the local optimum that we as people in this time and age can and want to deal with. If anything the syntax of JS and CSS could perhaps be unified (CSS is 90% JavaScript's object literal syntax; it adds selectors, allows hyphens in property names, and has quite a few notational amenities on the right hand side; other than that, it's like object notation). One can also imagine to express CSS in HTML which would be a bit clumsy but still somewhat usable. However, to unify markup syntax with imperative syntax is almost sure to fail. JSP (remember those?) and embedded PHP are two examples for how we do not want things to be. JSX looks a bit more viable. Svelte does this very interesting thing where they have a single file define the markup, the styling, and the behavior in a single file with three distinct parts; to me that looks like the future.
You are right but I think is not trivial to solve because contrary to programming languages LaTeX is interleaved with natural language and so almost everything is possible. Maybe the best approximation is to have heuristics. For example start with a valid document, introduce errors and train a neural network to identify the problem. Overkill?