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 extern.internalize/extern.externalize? #432

Closed
eqrion opened this issue Sep 18, 2023 · 5 comments · Fixed by #447
Closed

Rename extern.internalize/extern.externalize? #432

eqrion opened this issue Sep 18, 2023 · 5 comments · Fixed by #447

Comments

@eqrion
Copy link
Contributor

eqrion commented Sep 18, 2023

In discussions around adding an 'exnref' type (WebAssembly/exception-handling#280), it seemed like there was desire for it to be a new type hierarchy, like any and extern. If this is the case, it could be useful to have instructions to convert from 'exnref' to 'externref' or 'anyref'. This has sort of come up before (WebAssembly/exception-handling#202).

I can't think of a good name for these though, as 'extern.internalize/externalize' seem to have a builtin assumption that you just want to convert between those two hierarchies.

What would folks think about renaming to: any.from_extern and extern.from_any? This would allow a natural any.from_exn or extern.from_exn?

@tlively
Copy link
Member

tlively commented Sep 18, 2023

I would be fine with this.

@rossberg
Copy link
Member

Isn't the plan of record not to allow exnrefs to be passed to JavaScript? Then such a conversion wouldn't be very useful.

That said, I don't mind a more extensible naming scheme. Instead of from I'd probably use convert as a prefix, however, which is more consistent with how we spell numeric conversions.

@eqrion
Copy link
Contributor Author

eqrion commented Sep 19, 2023

Isn't the plan of record not to allow exnrefs to be passed to JavaScript? Then such a conversion wouldn't be very useful.

Hmm, my understanding was that this wasn't well discussed yet. It's fine if we disallow it, but I do think there is a good case for allowing it (and will make that on the EH issue).

That said, I don't mind a more extensible naming scheme. Instead of from I'd probably use convert as a prefix, however, which is more consistent with how we spell numeric conversions.

Yeah, that's fine with me. Even if we don't immediately allow this for exnref, I do think this is something that is likely to come up in some future extension.

@tlively
Copy link
Member

tlively commented Oct 4, 2023

I think the next step is to make a PR implementing this change. @rossberg, would you be up for that?

@rossberg
Copy link
Member

rossberg commented Oct 4, 2023

Sure, though I might not get to it for the next couple of weeks.

tlively pushed a commit to WebAssembly/binaryen that referenced this issue Jul 8, 2024
Rename instructions `extern.internalize` into `any.convert_extern` and
`extern.externalize` into `extern.convert_any` to follow more closely
the spec. This was changed in
WebAssembly/gc#432.

The legacy name is still accepted in text inputs and in the C and JS
APIs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants