Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upAtomics: Should ValidateSharedIntegerTypedArray allow a Proxy of a valid TypedArray? #1184
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
syg
Apr 24, 2018
Member
I recommend against. Given that Atomics is a low-level API for performance, the design spirit here should be easily compilable down to ISA-level atomic ops. Allowing Proxies wrapping SABs will mean JITs won't compile the Proxy case, which defeats the purpose of using Atomics in the first place.
|
I recommend against. Given that Atomics is a low-level API for performance, the design spirit here should be easily compilable down to ISA-level atomic ops. Allowing Proxies wrapping SABs will mean JITs won't compile the Proxy case, which defeats the purpose of using Atomics in the first place. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Apr 24, 2018
Member
If you wanted to permit Proxies of TypedArrays to be used in similar contexts, presumably you'd make several other changes to various places to access the internal slots of the underlying TypedArray. This would be a big change, and not quite in line with the general design of Proxies, which don't tend to get this sort of forwarding (Array.isArray being the one-off exception).
|
If you wanted to permit Proxies of TypedArrays to be used in similar contexts, presumably you'd make several other changes to various places to access the internal slots of the underlying TypedArray. This would be a big change, and not quite in line with the general design of Proxies, which don't tend to get this sort of forwarding ( |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
domenic
Apr 24, 2018
Member
Right, as mentioned previously, proxies are not generally transparent, and should not be.
|
Right, as mentioned previously, proxies are not generally transparent, and should not be. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
erights
Apr 24, 2018
erights
commented
Apr 24, 2018
|
On Tue, Apr 24, 2018 at 12:34 PM, Domenic Denicola ***@***.*** > wrote:
Right, as mentioned previously, proxies are not generally transparent, and
should not be.
I don't know what you mean by "generally". Proxies used as membranes are
practically transparent but are not absolutely transparent. (I sometimes
use "cooperatively transparent".) We've been over this many times so I
don't want to rehash this, but please avoid statements that are so easily
misunderstood. Proxies were designed to enable membranes to be transparent.
We should *generally* not break practical transparency and have not.
Array.isArray is not an exception. It is necessary to uphold practical
transparency.
The damaging non-uniformity is that built-in functions from one realm are
able to see internal slots of objects from another realms. Even proxies
aside, this is annoyingly inconsistent with classes using private fields,
or even classes using WeakMaps to emulate private fields.
All that said, for the specific question asked here, I have to agree that
membranes should not be transparent wrt atomic operations on SABs. I
hesitate to introduce another exception to the general transparency of
proxies, but I think our hand is forced on this one.
… —
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1184 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAQtzDTKfFTGRGhk-goAKzN2UMgJ_6bFks5tr34ugaJpZM4Th9g1>
.
--
Cheers,
--MarkM
|
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
littledan
Apr 25, 2018
Member
Offtopic, but where can I read an explanation of how Proxies are generally transparent?
|
Offtopic, but where can I read an explanation of how Proxies are generally transparent? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
rwaldron
Apr 25, 2018
Contributor
Thanks for the feedback. I came across this while writing Atomics tests for Test262, but I intentionally held back any context, to avoid tainting any responses. I suspect my use case isn't compelling enough to warrant further consideration.
|
Thanks for the feedback. I came across this while writing Atomics tests for Test262, but I intentionally held back any context, to avoid tainting any responses. I suspect my use case isn't compelling enough to warrant further consideration. |
rwaldron commentedApr 24, 2018
Pros? Cons?