HeadlinesBriefing favicon HeadlinesBriefing.com

WebAssembly Still Second-Class on Web Despite Progress

Hacker News •
×

WebAssembly has evolved significantly since its 2017 debut, adding features like shared memories, SIMD, exception handling, and garbage collection support. These capabilities have enabled more languages to target the web efficiently, narrowing the gap with native performance in many ways. Yet WebAssembly remains a second-class language on the web platform, limiting its broader adoption among developers.

While the WebAssembly CG has focused on expanding language capabilities, integration with the web platform itself has lagged behind. The core issue is that WebAssembly cannot directly interact with web APIs and must rely on JavaScript as an intermediary. This creates a cumbersome developer experience where even simple tasks like console logging require complex glue code and manual memory management.

Loading WebAssembly modules is unnecessarily complicated compared to JavaScript's simple script tags, though the esm-integration proposal aims to streamline this process. The real friction point comes when accessing web APIs, which requires generating language-specific bindings that add build complexity and runtime overhead. This technical friction pushes most developers to choose JavaScript even when WebAssembly might be a better technical fit, confining its use to large companies with resources to justify the investment.