That would be more of a library than a WASM spec thing, no? I wrote a code generator that does this well for some internal use-cases.