-
Book Overview & Buying
-
Table Of Contents
Learn WebAssembly
By :
In the previous chapter, we briefly covered Emscripten's Module object and how to load it in the browser. The Module object provides several convenient methods and differs significantly from the browser's WebAssembly object. In this section, we're going to review Emscripten's Module object in greater detail. We'll also discuss the difference between Emscripten's Module and the objects described in WebAssembly's JavaScript API.
Emscripten's official site provides the following definition for the Module object:
"Module is a global JavaScript object with attributes that Emscripten-generated code calls at various points in its execution."
Not only is the loading procedure different from WebAssembly's compile and instantiate functions, but the Module provides some helpful functionality out of the box that would otherwise require a custom implementation in WebAssembly. The Module is available in a global scope (window...