The Art of WebAssembly: Build Secure, Portable, High-Performance Applications

Aleksandr Shitik
Aleksandr Shitik

I write my own posts and books, and review movies and books. Expert in cosmology and astronomy, IT, productivity, and planning.

The Art of WebAssembly: Build Secure, Portable, High-Performance Applications
Rick Battagline
Genres: Programming
Year of publication: 2022
Year of reading: 2025
My rating: Normal
Number of reads: 1
Total pages: 312
Summary (pages): 14
Original language of publication: English
Translations to other languages: Russian

General Description

A 312-page book consisting of 11 chapters. Alongside text, it contains a significant amount of code. There are also many illustrations that clarify various examples. The reading level is advanced. Each chapter ends with a concise summary.

Quick Overview

The first two chapters serve as an introduction to the technology. The author explains why WebAssembly is needed, where it's used, and demonstrates ways to interact with it. The WebAssembly Text Format (WAT) is introduced, and the first program — Hello, world! — is covered. WAT is used throughout most of the book.

The next chapter focuses on functions and tighter integration with JavaScript. It covers data types, working with variables (global and local), conditional statements (if/else), loops, and branching. Some of these topics are touched upon as early as the second chapter.

Following this is a largely theoretical chapter dedicated to number handling. If you’ve ever worked with direct, one's complement, and two's complement representations, or bitwise operations (shifts, masks, XOR), this chapter will feel familiar and slightly nostalgic.

Next comes a chapter on strings, discussing ASCII and Unicode encoding, string storage in linear memory, and more.

The subsequent chapter dives deep into linear memory management. Based on this, an interesting example is built — a program detecting collisions between objects. This example is later expanded and refined.

Then come several chapters focused on building a complete mini web application. One covers setting up a Node.js server and interacting with the DOM, while another explores working with Canvas.

After that, the author explains how to debug WebAssembly code, identify and fix errors, and detect performance-heavy functions. These topics span two chapters.

The book concludes with a chapter on AssemblyScript — a high-level language specifically designed for WebAssembly. A performance comparison with other approaches is also presented.

My Take

This year marks WebAssembly's 10th anniversary — a mature enough age to assess how well it has met expectations and its current market role. Sure, big players like Google (Docs), Figma, and Photoshop use WebAssembly to rewrite performance-critical modules or entire components. Yet, overall adoption in web development remains slow, and JavaScript/TypeScript still dominate without serious competition.

One possible reason is the lack of built-in garbage collection, making WebAssembly less suitable for languages like Python or Java. Unlike C++ or Rust, which were designed with manual memory management in mind, such higher-level languages struggle to fit into WebAssembly's model (though notable progress has been made in recent years). Another limitation is the absence of direct DOM access. Attempting to use WebAssembly via compiled wrappers or excessive JavaScript calls can even result in slower performance than native JS code.

Reading this book gradually clarifies why WebAssembly is still limited to niche use cases and hasn't gained widespread traction in general application development. It's genuinely a complex technology. Imagine blending assembly language with a slightly higher-level syntax, then adding a Lisp-like structure. That's roughly what it feels like to read this book. I haven’t worked with low-level code in years, so many chapters were challenging. Of course, there were moments when I appreciated the approach and even enjoyed analyzing the code. But overall, the book felt quite demanding. For the first time in a while, I found myself wanting to break the author’s long sentences into shorter ones to better grasp the meaning.

For gaining a foundational understanding of WebAssembly and learning WAT, this book is excellent. But it's clearly not enough to start applying the technology in real-world projects right after finishing it.

Вверх