liveBook · Manning

Serialization

As explained in Server-Side WebAssembly

Serialization is the transformation of structured data into a representation suitable for storage or transmission.

Serialization transforms structured data into a representation suitable for storage, transmission, or communication across an application boundary. In WebAssembly components, WIT describes richer interface values, while the Canonical ABI defines how those values are packaged and unpackaged between a module and its host. section 2.4

WIT supports serialization-oriented interface types including:

  • Primitive values such as booleans, integers, floating-point numbers, characters, and strings. section 2.4
  • Lists, optional values, results, and tuples for collections, absence, errors, and grouped values. section 2.4
  • Records, enums, variants, flags, and type aliases for structured application data. section 2.4

A string crossing a Wasm boundary

A WIT world can export greet: func(name: string) -> string. The interface declares the structured values, and the Canonical ABI supplies the agreed rules for converting them between Wasm and the host runtime. section 2.4

How Server-Side WebAssembly covers it

How deep it goes
Explains interface types and Canonical ABI lifting and lowering, but does not detail their generated implementation.
Examples
Uses a greet function with string input and output, alongside lists, results, records, enums, variants, and flags.
What it assumes
Assumes familiarity with WebAssembly modules and host runtimes while introducing interface-level data types.
What you can do after
Apply it via WIT and the Canonical ABI to describe and exchange structured values across Wasm boundaries.
How it connects
Connects WIT with WebAssembly, interface definition languages, host runtimes, and the Canonical ABI.

Also explained in

Compare how 24 books explain serialization →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Server-Side WebAssembly. The section links point to the parts of the book it draws on.