Re: E4H and constructing DOMs

On Thu, 7 Mar 2013, Allen Wirfs-Brock wrote:
> 
> There is no reason an implementation (or a platform standard) couldn't 
> define a well known tag function that processes a well specified syntax 
> (eg, HTML)
> 
>    HTML`<label><input type="checkbox" name={name}
>               checked?={checked} disabled?={!enabled}/> {label}</label>`
> 
> such that a JS implementation could recognize the tag usage at 
> compile-time and statically check the syntax of the statically provided 
> portions of template strings that use that tag.  Alternatively, a 
> lint-like processor could could recognize such tags and produce 
> diagnostics for them.

If this:

   <script>
     alert('test');
     HTML`<a></b>`
   </script>

...would sometimes alert "test" and sometimes not, based purely on whether 
the browser defined this well-known tag function, then that's a reason 
why it couldn't happen.

If, on the other hand, you're saying we could require that browsers 
implement such a thing, then that's more interesting. The syntax is not 
quite as clean as E4H's, but maybe it's clean enough that it's ok?

Are there any browsers that have implemented quasis, or that are comitted 
to implementing quasis? If we're to reserve a prefix like this, we should 
do it sooner rather than later, so we don't get forced into particular 
compat constraints.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Thursday, 7 March 2013 18:43:31 UTC