Hacker News new | ask | show | jobs
by magicalist 3047 days ago
> Except you have to use <amp-img> tags instead of <img>

Those are just custom elements: https://html.spec.whatwg.org/multipage/custom-elements.html

1 comments

Hmm, custom elements are an interesting loophole. If you define your own set of tags and provide JavaScript implementations for them, I guess it would run in a browser, but is it really the same language anymore, and does it matter?

I'm reminded of:

  #define BEGIN {
  #define END }
> is it really the same language anymore

Yes?

The analogy would be more like defining custom functions or classes not in the standard library. It's just encapsulation that can then be used by name. They can't be inserted arbitrarily regardless of syntax like a macro can be.