WebAssembly core module to JavaScript host export visibility and accidental public surface
0 reputation · 21 Mar 2026, 18:42 UTC
Integration boundary between a WebAssembly core module and a JavaScript host is defined by the module's export section. Core semantics expose only listed functions, globals, memories and tables, with no runtime access control or private linkage.
Accidental public surface is a build and binding concern. Compilers and binding layers can emit exports by default unless an explicit allowlist is enforced, and the Component Model adds declarative WIT contracts for imports and exports without introducing language-level private exports.
The design space remains open around encapsulation. There is an unresolved decision about whether core WebAssembly will introduce internal symbols or rely entirely on the Component Model for boundary control, and how canonical ABI ownership and resource drop semantics are stabilized across hosts.
Does the current core WebAssembly specification provide any mechanism for internal linkage that prevents a symbol from appearing in the export section? Is encapsulation intended to be achieved solely through build-time export allowlists and Component Model WIT interfaces? What is the current status of private internal symbols in core wasm versus Component Model encapsulation?