You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 25, 2025. It is now read-only.
Every WebAssembly application will have embedder-specific code for a variety of reasons. For every (non-monolithic) application, that embedder-specific code will include coordinating separately compiled modules. At the very least, this code will be responsible for coordinating magic numbers like exception events. Far more often than not (maybe even always), this code will also be responsible for linking types. This linking code will be application-specific for a variety of reasons. It might depend on surface-language linking semantics (like class names). It might generate types (e.g. putting together private fields declared separately in superclasses to define the heap structure of a particular class). It might utilize embedder-specific loading and linking mechanisms (e.g. loading/compiling code in the background or on demand). It might employ dynamic adaptive techniques (e.g. load one implementation of a module or another depending on aspects of the device at hand). It might JIT entire modules. The list goes on.
The point is, this infrastructure will exist. That is important because it makes rtt.canon unnecessary even for the very few systems that even have the potential to benefit from it. Just like a Java application would surround a module with context like "import X needs to be linked to the class named java.util.ArrayList", a structural language could surround a module with context like "import Y needs to be linked to a 16-arity tuple", and in both cases the linking infrastructure can resolve the links appropriately (possibly JITing the tiny module it takes to define a 16-arity tuple).
From this perspective, rtt.canon does not appear so language agnostic—rather, it seems to bake into WebAssembly a specific kind of structural linking that only a few languages stand to benefit from. Regardless, rtt.canon is complicated and (especially in the Post-MVP extension) inefficient. So I think it (or more generally applicative rtt instructions) should be replaced with generative rtt instructions (like an rtt.fresh).