July 25, 2012 - TC39 Meeting Notes

Brendan Eich brendan at mozilla.org
Mon Jul 30 13:08:20 PDT 2012


Allen Wirfs-Brock wrote:
> On Jul 28, 2012, at 6:58 PM, Brendan Eich wrote:
>> Allen Wirfs-Brock wrote:
>>> I really think in a language where we have both [[Put]] and [[DefineOwnProperty]] semantics that we really need both = and :=
>> I can buy that, and I'm glad you mention := as it is not just an assignment operator (e.g. in Pascal or Ada), it's also Go's declare-and-init operator. It has the right characters, fuzzy meaning from other languages, and the critical = char in particular. I could see adding it as a winning and better user-interafce to Object.defineProperty and even Object.extend.
>>
>> However, Object.extend is usable in old and new browsers, with polyfill. Object.extend is the cowpath trod by many happy cows. Requiring a transpiler is harsh. Should we entertain both := and Object.extend, or perhaps the better name to avoid colliding with PrototypeJS, Object.define or Object.update?
>
> I think we should view := as new syntax that is primarily intended to be used in combination with other new syntax such as concise methods, class definitions, super, etc. that also require transpiling for use in older versions.   It is neither more or less harsh than any other new syntax. When we incorporate new syntax we are primarily making an investment for future ES programmers.  Transition issues need to be considered but I think that for ES, the future is still much longer and larger than the past.

Yes, I agree with that (as stated; it doesn't help with balancing 
polyfillability or making the right call on configurable+-writable).

> The problem with Object.extend is that it isn't a single cow path.  There are multiple path leading in the same general direction but taking different routes. This was the case in 2008 when we considered adding Object.extend for ES5 and it is even more so now.  We could add a completely new function such as Object.update, but I wonder if that is really needed.

The JSFixed project had Object.extend among its curated/moderated 
outcomes and I think it's a reasonable request. We rolled up 
Function.prototype.bind into ES5 in spite of several differences among 
the leading implementations (Dojo hitch, Prototype bind, etc.) and we 
changed the ES5 draft as we went.

>    Frameworks seem to be dong a fine job providing their own variants of Object.extend-like functions that are fine tuned to match their own abstraction models and other requirements.

This is not a sufficient argument on its face, since we got bind into 
ES5 in spite of variation.

Anyway, given the issue I raised about lack of writability being hard to 
test, or really: unlikely to be tested in practice, I don't think := (a 
good idea) motivates configurable+non-writable.

/be



More information about the es-discuss mailing list