Skip to content
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
This repository was archived by the owner on Apr 25, 2025. It is now read-only.

Clarification request: rtt.canon for structurally equivalent types #129

@jakobkummerow

Description

@jakobkummerow

(Inspired by #128 (comment))

Consider a module defining two structurally equivalent types:

(type $u (struct i32))
(type $v (struct i32))

Should (rtt.canon $u) and (rtt.canon $v) return the same RTT, or two different RTTs?
What if $u and $v are defined in two separate modules?

This impacts e.g. behavior of a check like: (ref.test (struct.new $u (i32.const 42) (rtt.canon $u)) (rtt.canon $v)).

A reason for returning the same RTT is that this appears to be a requirement for allowing cross-module interop to include RTT-involving operations without forcing the modules to agree on who exports and who imports the shared RTT. And behavior within a module should probably be the same as behavior across module boundaries.

A reason for returning different RTTs is that RTTs having nominal semantics was my initial understanding (and, in consequence, is the current behavior of V8's prototype implementation), but on further thought that was probably wrong (at least for rtt.canon) :-)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions