Why WebAssembly Is the Fourth Web Language and How It Boosts Performance
WebAssembly, now an official W3C web standard, provides a binary, memory‑safe sandbox for compiling languages like C/C++/Rust to run at near‑native speed in browsers and other environments, dramatically improving web performance and expanding the possibilities of web applications.
According to reports from Open Source China and other communities, the W3C‑certified web languages have been HTML, CSS, and JavaScript, and the alliance has now officially announced the WebAssembly Core Specification as a web standard, making WebAssembly the fourth web language.
WebAssembly (WASM) is a binary instruction format designed for a stack‑based virtual machine. It serves as a portable compilation target for high‑level languages such as C, C++, and Rust, enabling high‑performance client and server applications on the web and in many other environments.
WASM defines a memory‑safe sandbox execution environment that can even be implemented inside existing JavaScript virtual machines. When embedded in the web, it enforces the browser’s same‑origin and permission security policies.
Multiple implementations exist, including browser‑based and standalone systems. WASM is used for video and audio codecs, graphics and 3D, multimedia, games, cryptographic computation, and portable language implementations.
Version 1.0 of WASM is supported by Chrome, Firefox, Safari, and Edge browsers.
Because of its virtual instruction set design, WebAssembly allows loaded pages to run as native compiled code, improving web performance, achieving near‑native speed, optimizing load times, and serving as a compilation target for existing codebases.
Although the native type set is small, performance gains over JavaScript largely stem from its use of consistent types. WASM benefits from decades of compiler optimizations, with bytecode tuned for compactness and streaming. While downloading other code, the page can start executing, and network/API access is handled via accompanying JavaScript libraries with the same security model as JavaScript.
WASM is a binary instruction set for stack‑based virtual machines, designed as a compilation target for languages like C/C++/Rust to address JavaScript performance limitations. It is driven by the W3C and supported by Google, Microsoft, and Mozilla.
WASM offers efficient execution, memory safety, no undefined behavior, and platform independence, backed by a mature community.
Design Goals
Ontology currently supports NeoVM, a lightweight VM with built‑in integer, byte, struct, array, and dictionary types, where the host handles memory allocation, allowing many functions to be expressed with minimal bytecode. Many practical features are provided via native contracts as system calls.
Runtime API Design
WASM modules consist of type definitions, functions, globals, memory sections, tables, and import/export entries. A native Runtime module bridges the WASM VM and the blockchain, loading by default at VM startup for contracts to import and call.
Since WASM defines only memory blocks without built‑in allocation logic, either the Runtime provides malloc/free APIs or contracts manage memory themselves. Giving contracts control over memory improves extensibility and simplifies the Runtime API, though it requires contracts to allocate memory before the Runtime passes data.
Because WASM only supports simple types like u32 and u64, the Runtime defines an ABI codec to serialize complex data structures into byte arrays, write them into WASM memory, and let contracts reconstruct the original structures.
Summary
The "Ending Law" (proposed at the 2016 Emscripten conference) asserts that anything that can be implemented with WebAssembly eventually will be.
In theory, any language that can compile to LLVM can be compiled to WASM and run in the browser, effectively bringing desktop‑class software to the web.
Go 1.11 added WASM support, allowing Go programs to run in browsers with HTML‑based interfaces, highlighting the potential of browsers as the sole runtime environment for future operating systems.
Credits to Open Source China and other media sources.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
21CTO
21CTO (21CTO.com) offers developers community, training, and services, making it your go‑to learning and service platform.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
