Skip to content
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

Rename destroy() to dispose() #756

Closed
reillyeon opened this issue Aug 30, 2024 · 6 comments
Closed

Rename destroy() to dispose() #756

reillyeon opened this issue Aug 30, 2024 · 6 comments

Comments

@reillyeon
Copy link
Contributor

Since in many cases a resource continues to exist for a period of time while processing finishes I think it will be less confusing to developers to name these methods release().

@bbernhar
Copy link

bbernhar commented Sep 5, 2024

I'm unsure how WebNN's "destroy()" meaning differs from WebGPU's "destroy()" to justify a new name. Web developers should be familiar with "destroy" meaning delayed destruction. I could see release() being specifically useful for interop to mean "expire".

@inexorabletash
Copy link
Member

Bikeshedding: we could also use dispose()

This would align with Symbol.dispose from https://github.com/tc39/proposal-explicit-resource-management

@reillyeon
Copy link
Contributor Author

I have to say I don't feel particularly strongly about any of destroy(), dispose() or release(). Aligning with Symbol.dispose seems like the strongest argument for any of these words.

@reillyeon reillyeon changed the title Rename destroy() to release() Rename destroy() to dispose() Jan 22, 2025
@anssiko
Copy link
Member

anssiko commented Jan 23, 2025

Could we address this by updating the destroy() prose a la WebGPU's? It feels like developers' cognitive load would be lowered if we stay aligned with the WebGPU's verbiage?

@reillyeon
Copy link
Contributor Author

I agree that if most of the platform (particularly WebGPU) has chosen destroy() then we shouldn't introduce additional words even if they are technically more correct.

If there are no objections I am going to close this issue and paint the word "destroy" on the side of the bike shed.

@inexorabletash
Copy link
Member

I don't see any objections, so I'm going to close this on @reillyeon's behalf. Please comment or re-open if more discussion is warranted.

@inexorabletash inexorabletash closed this as not planned Won't fix, can't repro, duplicate, stale Feb 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants