
The different code types can call each other as required - the WebAssembly JavaScript API wraps exported WebAssembly code with JavaScript functions that can be called normally, and WebAssembly code can import and synchronously call normal JavaScript functions. With the advent of WebAssembly appearing in browsers, the virtual machine that we talked about earlier will now load and run two types of code - JavaScript AND WebAssembly. (Note that WebAssembly has the high-level goal of supporting languages with garbage-collected memory models in the future.)

Mobile and other resource-constrained platforms can further amplify these performance bottlenecks. We have run into performance problems, however, when trying to use JavaScript for more intensive use cases like 3D games, Virtual and Augmented Reality, computer vision, image/video editing, and a number of other domains that demand native performance (see WebAssembly use cases for more ideas).Īdditionally, the cost of downloading, parsing, and compiling very large JavaScript applications can be prohibitive. This has worked well for us as JavaScript is powerful enough to solve most problems people have on the Web today.

Historically, the VM has been able to load only JavaScript. A set of Web APIs that the Web app can call to control web browser/device functionality and make things happen ( DOM, CSSOM, WebGL, IndexedDB, Web Audio API, etc.).the JavaScript code that powers your apps. A virtual machine (VM) that runs the Web app's code, e.g.

The web platform can be thought of as having two parts:
