I'm confused about the design constraints on ES4
brendan at mozilla.org
Sat Nov 10 22:08:11 PST 2007
On Nov 10, 2007, at 9:52 PM, Mark Miller wrote:
> What I
> don't understand is: Why can't this switch change other aspects of the
> language being recognized, so long as this doesn't result in a larger
It could. We considered removing "with" from ES4. But as I noted,
migration costs (on order of unsinking sunk "with" costs, whether
good or bad -- sunk cost fallacy acknowledged!) loomed. Same thinking
about eval, but we do want to make it better under strict mode, and
possibly even under explicit version=4. So we could revisit "with"
too. Thanks for pointing this out.
> I'm using "with" here only as an example, to try to understand the
> nature of the compatibility constraints on the ES4 process.
Compatibility imposes footprint costs, but it also creates a
migration tax proportional to usage, roughly. We're trying not to
blow either footprint budget or migration budget. These are fuzzy,
hard to quantify and reason about; nice judgment is required.
> Let's say, hypothetically, that by removing "with" from ES4 (with the
> version switch) we could avoid adding something else to ES4. Let's say
> that the feature we could avoid adding is larger than the code needed
> to switch "with" on and off. Would the removal of "with" from ES4 then
> be an option? If not, what compatibility issue does it raise that
> isn't raised by the addition of the other keywords?
We went through this in considering reformed with. The reformed with
proposal is small in parser overhead, but we haven't evaluated
practical implementations' code costs for the runtime semantics
(ignore strict mode; any implementation supporting it has room for
lots of stuff). Our belief (mine anyway) was that you would hurt ES4
adoption-with-migration too much by removing with from version=4 and
you wouldn't save footprint enough; compared to adding reformed-with
support. We should check this belief now that we are getting on to
Good stuff, keep it coming.
More information about the Es4-discuss