Comment by fiddlerwoaroof
2 years ago
The thing is, you could use doctypes like a racket #lang to precisely opt into the new format. Same with the type attribute on style, script and link elements. I’ve always found it a bit sad that we haven’t really taken advantage of the built-in extension points of HTML and related technologies because they’re designed pretty well for breaking changes without breaking compatibility.
Still the same problem. You’ve to get people to use the extensions. You mentioned a few “back in the day” examples and nobody uses these. CSS got the push and gained critical mass initially and that’s that. There’s been plenty of improvements since of course and if you can disregard legacy platforms it all gets a lot easier but that’s where the experts you want to sway define their value.
Browsers update quickly enough now that you can adopt new features relatively aggressively for desktop sites. Wasm might even let us ship these extensions to the script and style tags through a separate distribution channel, enabling better adoption of alternate languages in the browser.
Finally, CSS itself is starting to get some more programmability via the Houdini APIs.
Like I say, if that was the solution it would have worked already. We have several iterations of CSS at this stage each solving the problems of the previous but if you want to develop a layout that people can actually use you still need to support the old browsers and you have to get the vast community of web developers who are “happy enough” with CSS to get on board and learn your toy alternative. If you want something more advanced there are plenty of well established macro languages atop CSS that you can use , much as you don’t need to know assembler to write modern applications
This sounds interesting - what do you mean by the "built-in extension points"?
I already listed them: doctypes, the lang/type attribute for script/style/link tags, and custom elements/attributes.
Back in the day, you could use alternate scripting languages in IE: VBScript shipped by default, but there was also the ability to install an ActiveX extension to enable Python and some others in the script tag.