1. 2

    1. 2

      Hm I guess they want to eliminate print statements and use “unparse” derived from a grammar instead.

      I think the ES6 auto-escaping approach is pretty much as good and still lets you use print statements…

      You define an html() function and then tag the literal with it:

      console.log(html`<b>${username} says</b>: "${tag}"`);


      Also I criticized the broader program here:


      I think they picked a good example in HTML, because a subset of it can be described well with a CFG. But CFGs don’t work well for many network formats. With respect to parsing, HTML is more like a programming language than a network protocol.