Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
mohamedkhallouq
GitHub Repository: mohamedkhallouq/content
Path: blob/main/files/en-us/webassembly/index.md
6524 views
---
title: WebAssembly slug: WebAssembly browser-compat: javascript.builtins.WebAssembly
---

{{WebAssemblySidebar}}

WebAssembly is a new type of code that can be run in modern web browsers — it is a low-level assembly-like language with a compact binary format that runs with near-native performance and provides languages such as C/C++, C# and Rust with a compilation target so that they can run on the web. It is also designed to run alongside JavaScript, allowing both to work together.

In a Nutshell

WebAssembly has huge implications for the web platform — it provides a way to run code written in multiple languages on the web at near native speed, with client apps running on the web that previously couldn't have done so.

WebAssembly is designed to complement and run alongside JavaScript — using the WebAssembly JavaScript APIs, you can load WebAssembly modules into a JavaScript app and share functionality between the two. This allows you to take advantage of WebAssembly's performance and power and JavaScript's expressiveness and flexibility in the same apps, even if you don't know how to write WebAssembly code.

And what's even better is that it is being developed as a web standard via the W3C WebAssembly Working Group and Community Group with active participation from all major browser vendors.

Guides

API reference

  • WebAssembly instruction reference

    • : Reference documentation with interactive samples for the set of WebAssembly operators.

  • WebAssembly JavaScript interface

    • : This object acts as the namespace for all WebAssembly related functionality.

  • WebAssembly.Global()

    • : A WebAssembly.Global object represents a global variable instance, accessible from both JavaScript and importable/exportable across one or more WebAssembly.Module instances. This allows dynamic linking of multiple modules.

  • WebAssembly.Module()

    • : A WebAssembly.Module object contains stateless WebAssembly code that has already been compiled by the browser and can be efficiently shared with Workers, and instantiated multiple times.

  • WebAssembly.Instance()

    • : A WebAssembly.Instance object is a stateful, executable instance of a Module. Instance objects contain all the Exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.

  • WebAssembly.compile()

    • : The WebAssembly.compile() function compiles WebAssembly binary code into a WebAssembly.Module object.

  • WebAssembly.compileStreaming()

    • : The WebAssembly.compileStreaming() function compiles a WebAssembly.Module directly from a streamed underlying source.

  • WebAssembly.instantiate()

    • : The WebAssembly.instantiate() function allows you to compile and instantiate WebAssembly code.

  • WebAssembly.instantiateStreaming()

    • : The WebAssembly.instantiateStreaming() function is the primary API for compiling and instantiating WebAssembly code, returning both a Module and its first Instance.

  • WebAssembly.validate()

    • : The WebAssembly.validate() function validates a given typed array of WebAssembly binary code.

  • WebAssembly.Memory()

    • : A WebAssembly.Memory object is a resizable {{jsxref("Global_objects/ArrayBuffer", "ArrayBuffer")}} that holds the raw bytes of memory accessed by an Instance.

  • WebAssembly.Table()

    • : A WebAssembly.Table object is a resizable typed array of opaque values, like function references, that are accessed by an Instance.

  • WebAssembly.Tag()

    • : The WebAssembly.Tag object defines a type of WebAssembly exception that can be thrown to/from WebAssembly code.

  • WebAssembly.Exception()

    • : The WebAssembly.Exception object represents a runtime exception thrown from WebAssembly to JavaScript, or thrown from JavaScript to a WebAssembly exception handler.

  • WebAssembly.CompileError()

    • : Creates a new WebAssembly CompileError object.

  • WebAssembly.LinkError()

    • : Creates a new WebAssembly LinkError object.

  • WebAssembly.RuntimeError()

    • : Creates a new WebAssembly RuntimeError object.

Examples

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also