Extern and the relationshop with host #555
-
The GC spec introduces the notion of ref.host, ref.extern essentially becomes a wrapper around other reference runtime values. Is it expected that ref.host values are always wrapped in ref.extern, for instance if a host function needs push a value to the stack which wasm doesn't support. If so would the reference type of this value be ref extern? and technically its inner is heap type of any but it doesn't appear you can encode that in the type system 🤔 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
That sounds right to me. |
Beta Was this translation helpful? Give feedback.
That sounds right to me.
any.convert_extern
can convert anyextern
reference into anany
reference, but how that works is up the engine. On some enginesany
andextern
may have the same representation, so the conversion can lower to a no-op. On other engines, the representations may be different, so the engine may need to use a wrapper object that is compatible with theany
reference representation. The spec does not control these implementation details.