Chapter 5: Understanding Sections in WebAssembly Modules

A WebAssembly module is composed of zero or more sections. Each section has its own functionality. In the previous chapters, we saw how functions are defined inside a WebAssembly module. A function is a section inside a WebAssembly module.

In this chapter, we will explore the various other sections inside a WebAssembly module. Understanding the various sections inside a WebAssembly module will make it easier for us to identify, debug, and write efficient WebAssembly modules. We will cover the following sections in this chapter:

  • Exports and imports
  • Globals
  • Start
  • Memory

Technical requirements

You can find the code files present in this chapter on GitHub at https://github.com/PacktPublishing/Practical-WebAssembly/tree/main/05-wasm-sections ...

Get Practical WebAssembly now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.