WebAssembly Text

What is WebAssembly Text (WAT)?

If you pass a compiled WebAssembly1 module (a .wasm file) through a decompiler, you will get the text representation of the op codes used by that program.

This text representation is known as WebAssembly Text (or WAT), and it is now possible to write programs directly in this text representation.

But WebAssembly is Just a Compilation Target, So Why Bother?

WebAssembly certainly is a compilation target, and it is certainly true that the majority of WebAssembly programs will be generated by compilers, not humans. However, these facts should not be used to conclude that there are therefore no cases in which it would be beneficial to write a WebAssembly Text program by hand.

Although it is a very low-level development process, writing WebAssembly Text programs by hand brings the benefits of being able to build a very small, very efficient program suitable for performing highly repetitive, CPU-intensive tasks.

This introduction to WebAssembly Text serves as the starting point for subsequent posts that will describe how to implement the CPU-intensive calculations needed to plot the Mandelbrot and Julia Sets.

Table of Contents

  1. Please note: there is no space between the words “Web” and “Assembly”