No more modes?
mjs at apple.com
Thu Oct 14 15:30:11 PDT 2010
On Oct 14, 2010, at 2:54 PM, Brendan Eich wrote:
> On Oct 14, 2010, at 11:15 AM, Brendan Eich wrote:
>> On Oct 14, 2010, at 11:09 AM, Brendan Eich wrote:
>>> Fixing this is possible too, if I can take liberties:
>>> <script-if type="application/ecmascript;version=6">
>>> // new.js inline-exanded here
>>> </script-if else>
>>> <script ...>
>>> </script-if end>
>> In case some on es-discuss are not up on HTML and browser implementations of it, this would fall back on the <script ...></script> content in old browsers, because the </script-if else> looks like an end tag for <script-if type=...>. The fallback content is then processed as not in any container (in this example). The </script-if end> is a stray end tag, ignored.
>> New browsers that understood this mock-syntax (I'm not seriously proposing it, just sketching) would extend HTML parsing and processing to drop the content between the </script-if else> and the </script-if end>.
>> Again the goal would be no-extra-round-trips-with-fallback-for-pre-Harmony-(or-pre-any-version) browsers.
> I've been talking to Hixie (always stimulating! Also trying to get Maciej's attention.)
For what it's worth, I have noticed this thread, but have not had time to read it all and study the posts enough to give informed input.
My priors (before studying the thread closely):
- I don't like modes.
- If mode switching is necessary, I prefer in-band mode identification to external.
- Harmony will effectively have three modes - Harmony (with all new syntax), ES5 strict + new Harmony APIs, ES5 non-strict + new Harmony APIs.
- It seems per the current plan all three will have to be supported indefinitely. It's highly unlikely that currently deployed ES will all get replaced on anything less than geological time scalles.
- Is the Harmony spec going to take responsibility for defining all three of those modes, or with the latter two just be implicit in the combination of the ES5 spec and parts of the Harmony spec? I would prefer if it took responsibility for fully defining all the modes, but it's not clear if this is the current plan.
- Will we have to add yet another mode each time we add syntax? After enough iterations this becomes unsustainable.
I feel obligated to read the thread and think about it before proposing or evaluating specific solutions.
More information about the es-discuss