Standardizing __proto__

Brendan Eich brendan at mozilla.com
Fri Mar 18 13:05:07 PDT 2011


On Mar 18, 2011, at 9:20 AM, Oliver Hunt wrote:

> I believe the current hope is to kill off __proto__ as quickly as is possible.  I'm not taking a position in this argument, this is just my current understanding.

This makes it sound quick. There's no way to guarantee that.

Also, to kill it we need replacements for the valid use-cases, assuming we agree on those. These replacements need to have the right "fit" as well as "form", i.e., they must be usable.

Here's my framework for thinking about deprecation and obsolescence of __proto__:

1. A "get" equivalent: Object.getPrototypeOf in ES5.

2. A "define" (initialize on a newborn and otherwise inaccessible object) equivalent: see Object.create, but people criticize it on usability grounds. So, see Allen's mail and the strawman he is championing:

http://wiki.ecmascript.org/doku.php?id=strawman:obj_initialiser_meta

3. Ship in multiple browsers, so library authors can detect and start to use them.

4. Wait a decent interval to evaluate usability.

5. Announce removal of __proto__ in subsequent releases of those multiple browsers.

6. Evaluate market share of downrev browsers as those release dates approach.

7. If all looks good, remove __proto__, done.

8. Else goto one of the earlier steps, possibly adjusting specs and impls based on feedback and uptake.

This is *not* going to be "quick".

/be

> 
> That said your examples environments that support it is slightly misleading as there's only a few JS engines being used between them: Caraken (Opera person is this correct?), JavaScriptCore, SpiderMonkey and V8.   AIR uses webkit so pulls in JSC, and presumably ActionScript as well, although ActionScript is not really an ES engine so i'm unsure if it counts to this discussion.
> 
> --Oliver
> 
> On Mar 18, 2011, at 9:14 AM, John-David Dalton wrote:
> 
>> The __proto__  property has been around for ~13yrs and is now a de
>> facto standard supported by Chrome, Firefox, Safari, Opera, Adobe
>> Flash, Adobe AIR, Rhino, Ringo, Narwhal, & Node.js.
>> It's available on desktops, mobile phones, tablets, and even eReaders.
>> 
>> The __proto__ property is a powerful language feature that cannot be
>> reproduced through any existing part of the language.
>> Current proposals like,
>> http://wiki.ecmascript.org/doku.php?id=strawman:array_create, are too
>> limiting, (it's useful for more than just arrays) and don't cover the
>> full functionality/flexibility of __proto__.
>> 
>> I propose making it official by beginning the process of standardizing
>> __proto__ or some addition of equal utility.
>> 
>> More info:
>> https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Object/proto
>> https://bugzilla.mozilla.org/show_bug.cgi?id=642500
>> 
>> - John-David
>> _______________________________________________
>> es-discuss mailing list
>> es-discuss at mozilla.org
>> https://mail.mozilla.org/listinfo/es-discuss
> 
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss



More information about the es-discuss mailing list