Ask HN: Why do we still build the web in XML?
I know that JSX and HTML aren't XML, but they practically are. Yes, there are template engines, and markdown, but they both transpile to HTML, and because of that they're forced or at least limited by it's basic "isms" of structure. Or have I not been using the right ones??
Sorry, I'm tired of closing <div> tags.
12 comments
[ 2.7 ms ] story [ 45.2 ms ] threadXML fell out of SGML - trust me, you don't want to go there. So did HTML.
Also too: the IDEs I use always form closed tags. No effort needed.
There are definitely plugins for auto-closing your HTML tags that will make your life easier, though.
1. https://en.wikipedia.org/wiki/Gopher_(protocol)
2. https://en.wikipedia.org/wiki/Wide_area_information_server
3. https://en.wikipedia.org/wiki/Project_Xanadu
4. https://en.wikipedia.org/wiki/HyperCard
5. https://en.wikipedia.org/wiki/Java_applet
6. https://en.wikipedia.org/wiki/NeWS
And so on...
Upon further consideration, maybe just closing the <div> tags isn't so bad after all...
All of that said, you can still get Java in the browser working today, albeit not applets per-se, using JNLP / JWS. It takes some effort considering JWS was removed from the base JDK a while back, but there is an open source effort to keep it alive.
https://openwebstart.com/
Avoid this feeling of mental toil by using a text editor which does this for you.
https://www.destroyallsoftware.com/talks/wat
https://youtu.be/D5xh0ZIEUOE
Can't we just get WASM browser APIs and then do the web in whatever programming language we want?
Modern web is not always user friendly, and many users benefit from ad blocking, data extraction, per-site fixeups and so on. The limited and flaky Javascript helps a lot - we can block the 3rd party script, and the pages will continue displaying without the ads; any data fetching is via browser's http engine and in most cases using JSON or XML format; and the sites are expected to support a wide range of browser features so they are often compatible with much older/newer browsers.
Now imagine web using "compiled language" model (or if you are old enough, remember ActiveX or Flash-as-entire-website): you get that immutable blob of binary code and there is very little you can do. Reverse-engineering it is non-trivial, takes a lot of time and any patches you produce may break with the next release. A trivial change like making input box a big bigger is a major effort.
(one may say: "but wait! WASM will only replace Javascript, the HTML/DOM will still stay around, so it would not be that bad!". You are too optimistic, I bet there right now, there are people who want to do it all in WASM and only need canvas from web browser.)
Viva la semantic and expressive HTML code!
JSX may have solidified the XML markup style in the developer's toolbox though. Especially with server side rendering too.