Why is WebAssembly a second-class language on the web?

Ryan Hunt · 2026年2月26日

AI 摘要 AI 生成,可能有误

尽管自2017年发布以来已显著成熟,WebAssembly在Web上仍然是一种二等语言,因为它缺乏与平台的紧密集成:加载Wasm代码十分繁琐,而访问Web API则需要冗长的JavaScript'胶水代码',这些代码增加了构建复杂性和运行时开销。这种糟糕的开发者体验促使普通开发者继续使用JavaScript,从而将WebAssembly的好处仅限于那些有足够资源来证明其投资合理性的大型公司。作者认为,既然该语言本身如今已经成熟,社区应该把重点放在解决平台集成问题上,潜在的途径是WebAssembly Components。

This post is an expanded version of a presentation I gave at the 2025 WebAssembly CG meeting in Munich.

WebAssembly has come a long way since its first release in 2017. The first version of WebAssembly was already a great fit for low-level languages like C and C++, and immediately enabled many new kinds of applications to efficiently target the web.

Since then, the WebAssembly CG has dramatically expanded the core capabilities of the language, adding shared memories, SIMD, exception handling, tail calls, 64-bit memories, and GC support, alongside many smaller improvements such as bulk memory instructions, multiple returns, and reference values.

继续阅读全文

为了尊重作者,这里只展示开头几段。你可以去原文阅读,或者在 HorizonReader 里读:划线做笔记、让 AI 帮忙。

更多来自 Mozilla Hacks

Intent to Ship: JPEG XL

AI 摘要Mozilla has announced its intent to ship JPEG XL support in Firefox, based on jxl-rs, a safe and compact Rust decoder built by Google Research after concerns about the attack surface of the original 100,000-line C++ implementation. Firefox's implementation includes progressive rendering, which lets images display as they download, a feature Safari's earlier version lacked. The article also compares JPEG XL with AVIF, noting that AVIF tends to produce smaller files at web quality, while JPEG XL excels at lossless imagery and recompressing existing JPEGs, so developers should choose based on their use case.

PACT: Anonymous Credentials for the Web

AI 摘要The article describes how websites' anti-bot defenses are increasingly failing, as browser privacy protections erase passive signals and generative AI renders CAPTCHAs ineffective, forcing users into a dilemma between privacy and access. It critiques device-attestation solutions like Google's Web Environment Integrity and Apple's Private Access Tokens for concentrating control in hardware manufacturers and threatening the open web's openness. As an alternative, Mozilla proposes a system of anonymous credentials built on Privacy Pass-style cryptography, where sites can rate-limit users anchored to scarce resources (such as email addresses or VPN subscriptions) without learning their identities, while open challenges like issuer blinding and issuer trust evaluation remain to be solved.

Announcing Web Serial Support in Firefox

AI 摘要Firefox 151 for Desktop now supports the Web Serial API, enabling web applications to communicate directly with serial-connected hardware such as microcontrollers, development boards, 3D printers, and power meters without native software. Mozilla collaborated with Adafruit to test the implementation against real hardware workflows, and security is handled through explicit per-site, per-port user permission prompts. Mozilla is also pursuing standardization of the API through the WHATWG.

Behind the Scenes Hardening Firefox with Claude Mythos Preview

AI 摘要Mozilla explains how it used Claude Mythos Preview and other AI models, driven by an agentic harness built atop its fuzzing infrastructure, to find and fix an unprecedented number of latent security bugs in Firefox, including sandbox escapes and bugs dating back 15-20 years, with 271 fixes shipped in Firefox 150. The team scaled the effort by parallelizing bug-hunting jobs across ephemeral VMs and integrating discovery into its full security bug lifecycle of deduplication, triage, and shipping fixes, noting that better models and harnessing techniques transformed AI bug reports from low-value noise into high-signal findings. Mozilla has published a sample of the bug reports, recommends that other software projects begin using these AI-assisted hardening techniques now, and plans to integrate this analysis into continuous integration to scan patches as they land.

Trustworthy JavaScript for the Open Web

AI 摘要Mozilla introduces WAICT (Web Application Integrity, Consistency and Transparency), a mechanism that cryptographically binds client-side web code to manifests committed to publicly auditable logs, protecting applications—even end-to-end encrypted ones—against malicious or compromised servers serving modified code. Sites can opt in to enforcement so browsers reject any code that has not been publicly logged, making attacks observable and attributable. An early prototype is available in Firefox Nightly and can be tested at waict.dev, with Mozilla collaborating with partners like Cloudflare, the Freedom of the Press Foundation, and Meta while developing the specifications openly.