Description
I noticed in the GC doc that there is no mention of tagged pointers. I wanted to make the case for it. When compiling languages that might heavily rely on tagged unions (such as Rust or OCaml) with GC interop you will have to store the tag as a separate field which can be quite inefficient.
Even as part of the initial proposal for opaque reference types, it would be nice to expose a way to allow a tag to be associated with the reference.
I realize that not all architectures or VM implementations will be able to take advantage of this and might even need to box in some cases. The available space for a tag may also already be used by the JS VM to store its type information. However, for environments that can take advantage, it would be very helpful to have the appropriate affordances.
I could imagine this being related to a possible JavaScript enum proposal as well (which I'm interested in exploring in TC39). That could be the JavaScript representation of this value.