assemblyscript
assemblyscript copied to clipboard
BREAKING CHANGE: Remove externref in favour of anyref
Continue of removing externref which superseded by anyref. See prev part: #2302
Also see spec changes: https://github.com/WebAssembly/gc/pull/271
anyref allowing in reference types proposal now
- [x] I've read the contributing guidelines
- [x] I've added my name and email to the NOTICE file
There is still some uncertainty around this subject in the spec. Could well be that anyref is removed, or that externref is reintroduced, and I can't really tell from the discussions so far where matters are heading.
If we only want to align with Binaryen, which removed externref, I think we should keep externref around as an alias of anyref, avoiding a breaking change that would differ from the current state of reference types. Then implies that, depending on whether the GC feature is enabled, the consolidated anyref either behaves like the previous externref (in particular assignability), if not enabled, or, if enabled, like the anticipated anyref that can be assigned any *ref. The latter is also still an open question when it comes to funcref, but no decision there yet as well.
So in general I think that we should prefer reference types' current state, and add still in flux GC changes on top if enabled.