Cloud Native 33 min read

WebAssembly (WASM) Usage Scenarios and Future Trends

This article surveys the diverse scenarios where WebAssembly is applied—from accelerating web applications and providing sandboxed plugins to powering cloud‑native workloads, edge computing, serverless functions, mobile/IoT devices, and blockchain—while also outlining current challenges and future development directions.

ByteDance Web Infra
ByteDance Web Infra
ByteDance Web Infra
WebAssembly (WASM) Usage Scenarios and Future Trends

1. Introduction

After covering the basic concepts and usage of WebAssembly (WASM) in previous chapters, this section explores the various scenarios where WASM is employed and discusses its future development trends.

2. Scenarios

The name WebAssembly reflects its original goal: fast execution in web environments. Today WASM runs in browsers, cloud‑native platforms, mobile devices, IoT, blockchain, and more. Typical goals include accelerating browser‑based apps, providing sandboxed execution, enabling plugin systems, and allowing cross‑language interoperability.

Accelerate browser‑based applications, partially replacing JavaScript.

Serve as a sandboxed environment that adds security for host applications.

Implement plugin systems that extend product capabilities.

Compile different programming languages to WASM to enable interoperability.

Figures 1‑3 (from "The State of WebAssembly 2022") show the distribution of WASM usage across domains and its evolution from 2021 to 2022, highlighting the dominance of browser and cloud‑native scenarios.

2.1 Web Environment

WASM was originally designed to run code faster in browsers by compiling non‑JavaScript languages (e.g., C/C++, Rust, Go) to low‑level bytecode modules that browsers can execute directly.

Browser support for WASM objects such as WebAssembly.Memory , ArrayBuffer , SharedArrayBuffer , and WebAssembly.Instance is illustrated in Figure 4.

2.1.1 Video Decoding and GUI Controls

WASM can be used for video decoding and GUI widgets in browsers. HTML5 supports MP4, WebM, and Ogg, but support varies across browsers (e.g., Ogg is unsupported in Safari, WebM in only ~58% of browsers, MP4 disabled by default in Firefox 24+).

Typical solutions include legacy Flash players, native web players, or transcoding FLV to MP4 on the client. Companies like iQIYI and Tencent use the third approach, achieving ~20% performance improvement after switching from JavaScript to WASM (see Figure 5).

2.1.2 Graphics Rendering

Qt added WASM support starting with version 5.11, allowing cross‑platform C++ GUI applications to run in browsers without separate builds for each OS (Figure 6).

Other browser‑based applications such as Figma, AutoCAD, and Google Earth also leverage WASM. Figma’s load time improves significantly with WASM compared to asm.js (Figure 8).

2.1.3 Browser‑Based VR and Gaming

WASM enables modern game engines (e.g., Unreal, Unity) to target browsers, replacing deprecated Flash or Java applets. Notable examples include the port of Doom 3 to WebAssembly (Figure 9). WASM’s low latency also benefits VR applications.

2.1.4 Other Web Applications

TeaVM compiles Java bytecode to JavaScript and WASM, enabling Java, Kotlin, and Scala to run in browsers. DuckDB‑WASM brings an in‑browser analytical SQL engine, while Box2D‑WASM provides a 2D physics engine for web games (Figure 11).

2.2 Cloud‑Native Scenarios

Cloud‑native computing packages applications into containers for deployment on cloud platforms. WASM can be used both for cloud‑native applications and for the underlying infrastructure.

2.2.1 Cloud‑Native Applications

WASM integrates with Kubernetes to improve portability. Two main approaches are:

Traditional Containers

Containers package applications and dependencies for lightweight virtualization. Docker announced a WASM preview in late 2022, replacing the runC shim with WasmEdge to run WASM modules directly (Figure 13).

Krustlet

Krustlet is a Rust‑based Kubelet implementation that schedules WASM workloads instead of traditional containers. It monitors Pods via the standard List and Watch API and reports status to the API server. As of late 2022, Krustlet is considered a proof‑of‑concept and is no longer actively maintained.

2.2.2 Cloud‑Native Application Distribution

WAPM (WebAssembly Package Management) functions like NPM for distributing WASM artifacts.

2.2.3 Cloud‑Native Platform Capabilities

WASM extensions are being added to service meshes. Envoy Proxy supports WASM extensions via Proxy‑WASM, enabling custom functionality (Figures 15‑16). Istio uses Envoy as a sidecar to provide service discovery, load balancing, mesh, logging, and security.

2.2.4 Edge Computing

Traditional containers are too heavy for many edge devices. WASM offers a lightweight alternative. Fastly’s Lucet/Wasmtime powers Compute@Edge, delivering sub‑100 µs cold starts (Figure 17). Cloudflare Workers integrate WASM via the V8 engine, supporting C/C++ and Rust for edge‑side compute (Figure 18).

2.2.5 Function‑as‑a‑Service / Serverless

Serverless platforms traditionally rely on sandboxed containers, which incur higher latency and resource usage. WASM’s security, portability, and low‑overhead make it ideal for millisecond‑scale cold starts and fine‑grained capability‑based security (WASI).

Examples include Tencent Cloud SCF Custom Runtime (with WasmEdge), AWS Lambda integrating WasmEdge, and various AI inference workloads.

2.3 Mobile Devices, IoT, and Embedded Systems

WASM brings near‑native performance to constrained devices. Samsung’s Tizen, Xiaomi’s VelaOS, and Alibaba’s Waft framework all embed WASM runtimes for smart TVs, IoT, and AIoT applications.

2.4 Blockchain

Ethereum’s upcoming eWASM format replaces the EVM bytecode, offering higher speed, pre‑compilation, and language flexibility. Other blockchains such as Cosmos and Polkadot also adopt WASM for smart contracts.

2.5 Other Scenarios

Fluvio uses WASM‑based SmartModules for inline stream processing. Deno is a secure JavaScript/TypeScript runtime built on V8, Rust, and Tokio that can execute WASM modules. WasmCloud provides a platform for secure, portable, reusable components (Actors) powered by WASM. 2.6 Future Development Better developer experience: debugging, tooling, and compilation workflows need improvement. Continued standardization: ongoing work by W3C, Bytecode Alliance, CNCF, and major cloud vendors. Language support expansion: beyond C++, Go, and Rust to Python, Java, PHP, etc. Community and evangelism: CNCF, Bytecode Alliance, and other organizations are promoting adoption. 3. Conclusion WASM is a rapidly evolving technology with many current applications and a promising future. While still early, it offers a blue‑sea of opportunities for developers to create new value. 4. References [1] The State of WebAssembly 2022 – https://blog.scottlogic.com/2022/06/20/state-of-wasm-2022.html [2] The Wasm Application & Infrastructure Landscape – https://sapphireventures.com/blog/whats-up-with-webassembly-computes-next-paradigm-shift/ [3] WebAssembly – https://developer.mozilla.org/en-US/docs/WebAssembly [4] iQIYI Live Streaming WASM Optimization – https://cloud.tencent.com/developer/news/464897 [5] Qt for WebAssembly Beta – https://www.codercto.com/a/15920.html [6] Envoy Tutorial – https://www.amoyw.com/2021/03/05/envoy/ [7] Write WASM filters for Envoy – https://www.alibabacloud.com/help/en/alibaba-cloud-service-mesh/latest/write-wasm-filters-for-envoy-and-deploy-them-in-asm [8] Lucet performance – https://www.fastly.com/blog/lucet-performance-and-lifecycle [9] Custom SDKs on Compute@Edge – https://developer.fastly.com/learning/compute/custom/ [10] Cloudflare Workers Security Model – https://developers.cloudflare.com/workers/learning/security-model/ [11] Cloudflare Workers Hello World in Rust – https://developers.cloudflare.com/workers/tutorials/hello-world-rust/ [12] High‑performance WASM serverless on Tencent Cloud – https://juejin.cn/post/6994377781979283470 [13] WebAssembly serverless functions in AWS Lambda – https://www.cncf.io/blog/2021/08/25/webassembly-serverless-functions-in-aws-lambda/ [14] WASM vs EVM – https://www.panewslab.com/zh/articledetails/D28830508.html [15] WASM will lead the next generation of compute – https://www.oschina.net/news/214580

cloud nativeserverlessedge computingWASMWebAssemblybrowserblockchain
ByteDance Web Infra
Written by

ByteDance Web Infra

ByteDance Web Infra team, focused on delivering excellent technical solutions, building an open tech ecosystem, and advancing front-end technology within the company and the industry | The best way to predict the future is to create it

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.