News for hackers. Stuff that matters.
Re:Accelerated Mobile Pages Project by julien on Wednesday October 07, 2015 @02:36PM (#10347982)
Exactly! The WEB! Not yet another format that a small percentage of people will ever use but that everybody else will have to deal with for centuries.
Re:Accelerated Mobile Pages Project by bryanlarsen on Wednesday October 07, 2015 @03:22PM (#10348352)
AMP is a subset of HTML.
Re:Accelerated Mobile Pages Project by cpeterso on Wednesday October 07, 2015 @04:35PM (#10348875)
AMP : HTML :: asm.js : JavaScript?
Re:Accelerated Mobile Pages Project by callumlocke on Thursday October 08, 2015 @06:30AM (#10351826)
That's a good analogy (as long as you mean "HTML" as a banner term to include the HTML spec and associated specs like CSS and Custom Elements [1]).

• AMP is a subset of HTML.

• Any normal HTML engine can, therefore, render any AMP file, without needing to know about the AMP spec.

• It's also possible to make an engine that specialises in rendering AMP (either exclusively, or by switching to a faster mode when it detects the file is just AMP).

• Even in normal HTML engines, AMP files will generally be fast because they avoid 'slow' parts of HTML.

The above points all hold true if you switch the terms to JavaScript and asm.js.

Where the analogy falls short:

• It's easy to write AMP by hand, but asm.js is really only meant to be generated by a compiler.

• Obviously, what is meant by 'fast' is very different in each case. In HTML:AMP, it's about things like reducing network usage, and avoiding layout thrashing by requiring up-front declarations of image dimensions, etc. In JS:asm.js, it's about making compiler optimisations possible so code can execute faster.

Note: AMP does create extra elements, like `<amp-img>`, but these are legit uses of the Custom Elements spec. You can see these elements rendering correctly in Chrome. [2]

[1] http://w3c.github.io/webcomponents/spec/custom/ [2] https://www.ampproject.org/how-it-works/

Re:Accelerated Mobile Pages Project by callahad on Wednesday October 07, 2015 @05:12PM (#10349126)
s/subset of/overlapping set with/

AMPHTML whitelists a handful of HTML tags, but adds a bunch of its own custom elements, like <amp-instagram>, <amp-img>, and <amp-ad> on top. It's neither a subset nor a superset of HTML in the common understanding of those terms.

Re:Accelerated Mobile Pages Project by cramforce on Wednesday October 07, 2015 @06:50PM (#10349682)
Custom elements are a thing in HTML. Using them doesn't make it a superset. http://w3c.github.io/webcomponents/spec/custom/