-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
JavaScript WeakRefs #321
Comments
Still at stage 2 |
Regarding the explainer, we would really prefer something designed to be read. The slides provided appear to be designed to be talked through. We have specific guidance on what an explainer should look like. |
Hey @tschneidereit: Thanks for filing the request! We had a chance to look through this at today's F2F in TOK and are generally supportive. In particular, we understand that WeakRefs will help reduce fracture in the platform when it comes to introducing WASM host bindings. To the extent that's true, we're excited to see this move forward. Regarding the explainer doc itself, the PDF from Dean seems to be nearly a year old. Have there been updates to the proposal since then? The factory method seems peculiar. As to integration with other web platform APIs, the various DOM collection types seem like they might benefit from WeakRefs, but it isn't yet clear to me if that will need to be done though new types or if compatible evolution of existing collections. In general we're excited to have this in the quiver for new feature designs. Thanks for bringing it to our attention, and best of luck at TC39. |
I want to apologize for the ambiguity here. You can find the current tentative draft API in this issue comment. This draft API does include a way to register a finalizer callback. We saw this as important, at the very least, because we don't want to encourage polling for a WeakRef to "go null".
Could you say something more about where you see WeakRefs tying into the web platform? My understanding was that the DOM collections which make GC visible were seen as a mistake not to be repeated. One reason why I thought TAG guidance would be useful here is that the design principles recommend against exposing GC, see w3ctag/design-principles#100 . |
I'll be back helping on this soon. I agree the PDF is stale wrt the proposal and needs serious update! |
@littledan Thanks for the pointer to the discussion of the new API. We're wondering whether this is ready for another round of feedback on the API as outlined in that comment, or whether we should wait for that discussion to be finalised. Thanks! |
@alice Probably not yet; there's still ongoing work on a new explainer from @tschneidereit . Apologies for the confusion. |
Thanks for the update! We're going to close this for now since there's not much we can do right now; once it's ready for another look, feel free to either
|
The proposal has now been significantly updated, and the proposal repository reflects the rough consensus of the many people who have been contributing. I think it would benefit from further review from the TAG. @plinss , could you reopen the issue? New explainer: https://github.com/tc39/proposal-weakrefs/ We will likely be considering this proposal for Stage 3 in the June 4-6, 2019 TC39 meeting; feedback before that meeting would be ideal, but we understand that this request is coming in a bit late. cc @gsathya |
For the file handle example, wouldn't it be better to report/log an error instead of actually closing the file handle - especially as it is seen as a programming error? |
I am not a big fan of the name |
Finalization sounds dangerous, but I do understand the use-cases. I am wondering whether a lot of GC might delay the event loop (which could be a problem) as all the finalizers are run right after microtasks and right before the event loop. |
A few notes here:
|
Since I wrote that statement, let me clarify: it's related to uses of WeakRefs by libraries, not internal browser implementations. For the specific worker with However the cycle problem is still valid outside of postMessage. |
Thanks for all of this helpful feedback. This gives us a lot to update in the explainer, consider changing in the specification, and clarify with implementers before standardizing. I just want to correct one misunderstanding:
Finalizers are run as a task, not in the microtask checkpoint. Did you see text in the proposal that suggested otherwise? See whatwg/html#4571 for details. |
Suggestion from Kenneth Christiansen w3ctag/design-reviews#321 (comment)
Thanks again for the timely feedback! We're discussing the name change in tc39/proposal-weakrefs#116, and I've drafted a clarified explainer at tc39/proposal-weakrefs#117 . |
Thanks for flying TAG! Hope the feedback was valuable! |
こんにちはTAG!
I'm requesting a TAG review of:
Further details (optional):
Note that this proposal directly impacts § 1.3 of the Design Principles. See below for further discussion.
You should also know that...
The proposal champions as well as TC39 overall, are well aware of the concerns that exposing GC timing information raises. The proposal is carefully designed to mitigate these issues by reducing the amount of information exposed, as well as the bandwidth with which it is exposed. In particular, the proposal contains mitigations against slight differences in GC timing breaking code. The champions as well as TC39 overall are confident that these mitigations are sufficient to prevent reduced interoperability and constraints on changes to engines' GC implementations.
We're particularly interested in the TAGs opinion on how the introduction of WeakRefs should influence the design of other web APIs, and what kinds of support for interop on the spec level the Ecma262 spec should provide.
Finally, note that while the crucial aspects of the proposal's semantics can be considered final, the API will change between now and January 2019, when we hope to advance it to stage 3. We don't expect these changes to impact other specifications, however.
We'd prefer the TAG provide feedback as (please select one):
Please preview the issue and check that the links work before submitting
For background, see our explanation of how to write a good explainer.
The text was updated successfully, but these errors were encountered: