New private names proposal

Mark S. Miller erights at google.com
Thu Dec 16 15:57:24 PST 2010


On Thu, Dec 16, 2010 at 3:51 PM, David Herman <dherman at mozilla.com> wrote:

> Without new syntax, isn't soft fields just a library on top of weak maps?
>

Semantically, yes. However, as a library, they cannot benefit from the
extraordinary efforts of all JavaScript engines to optimize inherited
property lookup. Nor from the GC benefits that follow from the transposed
representation explained at <
http://wiki.ecmascript.org/doku.php?id=strawman:inherited_explicit_soft_fields#a_transposed_representation>.
OTOH, if soft fields are built in and implemented in this transposed manner,
both benefits easily follow.





>
> Dave
>
> On Dec 16, 2010, at 3:47 PM, Mark S. Miller wrote:
>
>
>
> On Thu, Dec 16, 2010 at 3:23 PM, Brendan Eich <brendan at mozilla.com> wrote:
>
>> On Dec 16, 2010, at 2:19 PM, Mark S. Miller wrote:
>>
>> > Currently is JS, x['foo'] and x.foo are precisely identical in all
>> contexts. This regularity helps understandability. The terseness difference
>> above is not an adequate reason to sacrifice it.
>>
>> Aren't you proposing the same syntax x[i] where i is a soft field map, to
>> make exactly the same sacrifice?
>>
>> http://wiki.ecmascript.org/doku.php?id=strawman:names_vs_soft_fields
>
>
> I am **not** proposing these syntactic extensions. Neither am I avoiding
> them on that page, since the point of that page is to compare semantics, not
> syntax. The first paragraph (!) of that page clearly states:
>
> "This translation does not imply endorsement of all elements of the names
> proposal as translated to soft fields, such as the proposed syntactic
> extensions."
>
>
> The two issues are orthogonal. Whichever of Names or Soft Fields wins, we
> can have an orthogonal argument about whether the winner should use this
> syntactic shorthand. Conversely, whatever the outcome of the syntax argument
> in this thread, they would apply equally well to either semantics.
>
>
>>
>>
>> /be
>>
>>
>
>
> --
>     Cheers,
>     --MarkM
> _______________________________________________
> es-discuss mailing list
> es-discuss at mozilla.org
> https://mail.mozilla.org/listinfo/es-discuss
>
>
>


-- 
    Cheers,
    --MarkM
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/es-discuss/attachments/20101216/4494c83f/attachment.html>


More information about the es-discuss mailing list