by mmastrac · 7y ago · 0 comments
It's like NaCl/PNaCl - a good idea in theory, but created by a team that didn't do a great job at speccing something that could be long lived and satisfy other players than Google+Chrome.
[1] https://amp.dev/ru/documentation/guides-and-tutorials/learn/...
> Resources such as images, videos, audio files or ads must be included into an AMP HTML file through custom elements such as <amp-img>
From: https://github.com/ampproject/amphtml/blob/master/spec/amp-t...
Amp Specific Tags
<amp-img>
<amp-video>
<amp-ad>
<amp-fit-text>
<amp-font>
<amp-carousel>
<amp-anim>
<amp-youtube>
<amp-twitter>
<amp-vine> <amp-instagram>
<amp-iframe>
<amp-pixel>
<amp-audio>
<amp-lightbox>
<amp-image-lightbox>
None of that is "100% valid HTML".Other sunsets of HTML failed magnificently like XHTML basic and it’s siblings.
It's like complaining that BibTeX, LaTeX, AMSTeX et al aren't "TeX".
In the original incarnation of SGML, the whole point of the DTD and DSSSL was to be able to define new elements, and specify how they are handled. This seems perfectly legitimate and part of the HTML standard.
There may be other problems with AMP, but creating new high level elements that resolve to standard HTML elements, doesn't seem to be one of them, and arguing over whether something is named 'amp-img', or 'img' + some detailed validator that throws errors if you try to do anything with <img> off the rails, seems to be bike-shedding over naming, and if anything, I'd argue giving new names to a function to limit its inputs is more clear and readable, then adding precondition checks only.
If it's a standard, shouldn't there be some way for those elements to work without including someone else's JavaScript?
Not the crypto library https://nacl.cr.yp.to/
PNaCl was a "lazy" attempt at making this cross-platform by leveraging LLVM's intermediate format which was never designed to be a "format" like that.
WebAssembly is 10x better than either of those formats and you can see the benefits of having multiple players design something to work for a long-term horizon.