5 Strings in WebAssembly

This chapter discusses how to handle strings in WAT because WebAssembly doesn’t have a built-in string data type as high-level languages do. To represent string data in WebAssembly, you must set linear memory to ASCII or Unicode character values. You need to know where you’re setting your data in linear memory and how many bytes the string will use.

In this chapter, we’ll look at the ASCII and Unicode character formats before we explore the relationship between string objects and how to store them in linear memory. You’ll learn how JavaScript can retrieve the strings from linear memory and output them to the command ...

Get The Art of 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.