WebAssembly's managed data types use structural (isorecursive) type equality, where two structurally identical types in different rec groups are considered equivalent. True nominal typing—where each type declaration is unique—isn't directly supported, but the exception-handling proposal inadvertently provides it via 'tag' declarations. Tags behave like nominally-typed structs: construction uses 'throw', type-checking uses catch handlers, and field access is done via catch. Tags can be exported/imported between modules for principled composition. The post is framed as a troll, highlighting that the WebAssembly committee debated type imports for 7 years and effectively shipped a limited version through the exception-handling proposal. The author updated the Hoot Scheme-to-Wasm compiler to use the newer exception handling spec and is working on exception support in the Wastrel toolchain.

5m read timeFrom wingolog.org
Post cover image
Table of contents
cursèd nominal typingfin

Sort: