-
Notifications
You must be signed in to change notification settings - Fork 74
Clarification on i31ref nullability #124
Comments
I had a similar question when I implemented (Side note: it seems we went through a very similar journey as you did: in our internal representation, our |
Thanks Jakob, going with V8's approach now! Closing as this is answered, but if anyone has differing design insights, please let me know :) |
What @jakobkummerow said. Having a different nullability default for the i31ref shorthand was a pragmatic choice based on expected use cases, but it is a bit irregular. We can switch it around if folks think that's preferable. Opinions? |
So far I found that the irregularity requires frequent special casing of |
What about #130 ? |
Hmm, I don't really get the point in #130 ( |
The point of #130 is to treat tagged integers as orthogonal dimension in the type system the way nullability is. I think it's easier to separate |
In the MVP document, under reference types, the following is noted:
with
i31ref
equalling(ref i31)
not(ref null i31)
. This turned up during prototyping in Binaryen where the initial strategy was to default to the abbreviations, but with(ref i31) != (ref null i31)
, and with(ref null i31)
theoretically constructible, we'd then be missing a canonical name for(ref null i31)
. This is not a problem, as we can design this differently by defaulting to the heaptype representation with the abbreviations merely being aliases, but I'd like to know more about the design here, as it might also be that this is either an oversight or that it hints at(ref null i31)
being illegal?The text was updated successfully, but these errors were encountered: