© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2022
S. M. JainWebAssembly for Cloudhttps://doi.org/10.1007/978-1-4842-7496-5_4

4. WebAssembly with Rust and JavaScript: An Introduction to wasm-bindgen

Shashank Mohan Jain1  
(1)
Bangalore, India
 

This chapter discusses how WebAssembly-based modules can be invoked by the runtime host and vice versa.

WebAssembly allows only numeric data types (integer and float) to pass between the host and the Wasm module. Since most of the functionality of programs depends on complex types like strings and other custom data types, a programmer must encode and decode these integers/floats into the specific data type.

Fortunately for languages like Rust, Mozilla has provided a toolchain ...

Get WebAssembly for Cloud: A Basic Guide for Wasm-Based Cloud Apps 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.