Introduction to the WebAssembly Standard cover

Introduction to the WebAssembly Standard

Rating 4.0
Word count
164K words
Chapters
69
ISBN
9787115500595

Tags

Summary

WebAssembly is an emerging standard for a web virtual machine, designed for high portability, strong security, high efficiency (in both loading and execution), and the smallest possible program size. This book provides a detailed introduction to using WebAssembly programs in JavaScript environments, WebAssembly assembly language and binary format, with numerous simple and easy-to-understand examples. Using C/C++ and Go development environments as examples, it also explains how to develop WebAssembly modules in other high-level languages. This book is suitable for developers engaged in high-performance web front-end development and cross-language web application development, and can also serve as a WebAssembly standard reference for consultation at any time.

Editor's review

WebAssembly Standard Primer is a technical monograph for intermediate and advanced developers, written by Chai Shushan, a well-known domestic Go language expert and early WebAssembly evangelist. The book's value lies first in its timeliness—WebAssembly, one of the most closely watched frontier web technologies in recent years, is in a phase of rapid evolution, and this book, based on the Wasm MVP 1.0 standard and the latest developments in the related ecosystem, provides readers with a solid technical panorama. The author does not stop at the conceptual level but starts from low-level mechanisms such as binary format, text format, instruction set, and memory model to gradually build a complete knowledge system. The book's explanation of the Emscripten toolchain and C/C++ code compilation is particularly detailed, which is relatively rare in Chinese-language materials of this kind.

As an editor, I believe the book's unique advantage lies in its positioning as a "standard interpretation." Chai Shushan not only explains how to use WebAssembly but also deeply analyzes its design philosophy and specification details, helping readers understand the essence of the technology rather than merely mastering tools. The book contains numerous verified code examples and architecture diagrams, especially the graphical analysis of key concepts such as linear memory, tables, and host environment integration, which significantly lowers the learning barrier.

It should be noted that the book demands a relatively high level of computer science fundamentals from readers, requiring basic knowledge of assembly language or compiler principles. But precisely for this reason, it is better suited to technical explorers who are not satisfied with "knowing how to use it" but wish to deeply understand why WebAssembly can break through JavaScript's performance bottlenecks and how it can expand application scenarios outside the browser. Against the current backdrop of cloud-native and edge computing, the low-level perspective offered by this book will help developers better grasp the architectural trends of next-generation web applications.

Who it's for

A good fit for

  • Technical personnel with existing C/C++/Rust development experience who wish to port existing code to the web platform
  • Advanced developers with a strong interest in browser low-level technologies or compiler principles who wish to deeply understand WebAssembly's design philosophy
  • Technical decision-makers evaluating or designing high-performance web application architectures who need a comprehensive assessment of WebAssembly's applicability
  • Students or researchers in computer-related fields who wish to systematically learn cutting-edge web runtime technology systems

Not a good fit for

  • Pure front-end beginners who only wish to quickly grasp the basics of a framework (such as React/Vue)
  • Complete beginners with no programming background or only exposure to HTML/CSS/basic JavaScript

Reading tips

  1. It is recommended to read the first two chapters in full to establish a conceptual framework, then selectively delve into subsequent chapters according to practical needs
  2. When reading, practice the code examples with online tools such as the official WebAssembly Explorer to deepen understanding of the binary format
  3. Focus on Chapter 5 "WebAssembly JavaScript API" and Chapter 7 "Non-Browser Environments"; these two parts are key to technical implementation

About the publisher

Posts & Telecom Press China · Founded in 1953

Posts & Telecom Press is known for its strengths in science and technology, computing, and information and communications titles, and has extended its publishing into photography, art, software learning, and inspirational growth, giving it a fairly diverse range. Its catalog includes computing and communications works such as Refactoring and Patterns (Revised Edition) and Huawei Switch Learning Guide (Second Edition), alongside bilingual collector's editions such as The Little Prince (Chinese-English-French illustrated collector's edition), The Great Gatsby, and Three Days to See. Beijing Ten Years: 1980-1990 and Ghost Blade: WLOP Personal Illustration Collection reflect its presence in photography and art. Its authors include Antoine de Saint-Exupéry, Helen Keller, Joshua Kerievsky, Wang Da, Zhang Zhaozeng, and WLOP.

Contents

  1. 版权信息
  2. 内容提要
  3. 序
  4. 本书结构
  5. 致谢
  6. 资源与支持
  7. 第0章 WebAssembly诞生背景
  8. 0.1 JavaScript简史
  9. 0.2 asm.js的尝试
  10. 0.3 WebAssembly的救赎
  11. 第1章 JavaScript语言基础
  12. 1.1 console对象
  13. 1.2 函数和闭包
  14. 1.3 Promise对象
  15. 1.4 二进制数组
  16. 第2章 WebAssembly快速入门
  17. 2.1 准备工作
  18. 2.2 首个例程
  19. 2.3 WebAssembly概览
  20. 2.4 你好,WebAssembly
  21. 2.5 WebAssembly调试及代码编辑环境
  22. 第3章 JavaScript中的WebAssembly对象
  23. 3.1 WebAssembly对象简介
  24. 3.2 全局方法
  25. 3.3 WebAssembly.Module对象
  26. 3.4 WebAssembly.Instance对象
  27. 3.5 WebAssembly.Memory对象
  28. 3.6 WebAssembly.Table对象
  29. 3.7 小结及错误类型
  30. 第4章 WebAssembly汇编语言
  31. 4.1 S-表达式
  32. 4.2 数据类型
  33. 4.3 函数定义
  34. 4.4 变量
  35. 4.5 栈式虚拟机
  36. 4.6 函数调用
  37. 4.7 内存读写
  38. 4.8 控制流
  39. 4.9 导入和导出
  40. 4.10 start()函数及指令折叠
  41. 第5章 WebAssembly二进制格式
  42. 5.1 LEB128编码
  43. 5.2 头部和段数据
  44. 5.3 内存段和数据段
  45. 5.4 表格段和元素段
  46. 5.5 开始段和函数索引
  47. 5.6 全局段
  48. 5.7 函数段、代码段和类型段
  49. 5.8 导入段和导出段
  50. 5.9 自定义段
  51. 5.10 补充说明
  52. 第6章 Emscripten和WebAssembly
  53. 6.1 安装环境
  54. 6.2 你好,Emscripten!
  55. 6.3 C/C++内联JavaScript代码
  56. 6.4 C/C++调用JavaScript函数
  57. 6.5 JavaScript调用C导出函数
  58. 6.6 运行时和消息循环
  59. 6.7 补充说明
  60. 第7章 Go语言和WebAssembly
  61. 7.1 你好,Go语言
  62. 7.2 浏览器中的Go语言
  63. 7.3 使用JavaScript函数
  64. 7.4 回调Go函数
  65. 7.5 syscall/js包
  66. 7.6 WebAssembly模块的导入函数
  67. 7.7 WebAssembly虚拟机
  68. 7.8 补充说明
  69. 附录 指令参考

FAQ

What prior knowledge is required?
A solid background in C/C++ programming, an understanding of basic computer organization concepts (such as stack, heap, and instruction set), and basic familiarity with JavaScript and how modern browsers work are recommended. Readers without such a background may first supplement their knowledge of compiler principles and operating systems.
What are the main differences between this book and other WebAssembly tutorials?
This book focuses on a systematic interpretation of the WebAssembly standard itself rather than a tutorial on using a specific toolchain. It proceeds from the perspectives of binary format and virtual machine design and is better suited to readers who wish to delve into the technical underpinnings or participate in standard-related development. Most tutorials on the market focus more on application-level practice with tools such as Emscripten.
Is the content outdated? The WebAssembly standard evolves quickly.
This book is based on the WebAssembly MVP 1.0 core standard finalized in 2019, which has stabilized and been implemented by all major browsers. The book's foundational content on the core instruction set, memory model, text format, and so on remains fully applicable. For recently added extension features such as threads and SIMD, readers may supplement their learning with the latest official documentation.

Comments

Find this book

This site is an index: you start “Search all sources” in your browser, and the entries it lists all point to third-party sites; please judge their availability yourself.

About the author

柴树杉 Author

Chai Shushan is an author about whom limited public information is available; few details of his identity and career appear in the library records. What can be confirmed is that he focuses on technical writing, with two works collected so far. Both titles fall within computing and programming: WebAssembly Standard Primer introduces WebAssembly, a low-level technology standard for the web, in an introductory manner, while A Guide to Customizing the Go Language concentrates on using and customizing Go for readers with some programming background. The two books sit in the general computing and programming design categories, showing an interest that spans both low-level technical specifications and hands-on language practice. His writing emphasizes clarifying concepts and offering practical guidance, suiting readers who want a systematic introduction to the relevant technologies. Given the limited material, a full assessment of his style and broader influence is not yet possible.

丁尔男 Author

Ding Ernan is an author active in the field of computer technology writing, though publicly available information about him is limited and few identity details can be confirmed. Judging from the two works recorded in the library, his writing focuses on low-level technologies and programming language practice: one offers an introductory look at the WebAssembly standard, while the other examines customization and extension of the Go language. Such topics generally target developers with some foundation and require a solid understanding of language specifications, runtime mechanisms, and engineering practice. Ding Ernan's writing tends to combine conceptual explanation with practical guidance, aiming to make relatively niche or complex technical subjects clear and followable for readers who want to understand the details. Although his output is small, his choice of subjects reflects a sustained interest in emerging standards and the underlying mechanisms of programming languages.

More by the same author

Top rated in the same category