--- title: WebAssembly slug: WebAssembly tags: - Landing - WebAssembly - wasm translation_of: WebAssembly ---
WebAssembly é um novo tipo de código que pode ser executado nos navegadores da Web modernos — é uma linguagem de montagem de baixo nível com um formato binário compacto que é executado com desempenho quase nativo e fornece linguagens como C/C++ com um destino de compilação para que possam ser executadas na Web. Este também é projetado para funcionar com JavaScript, permitindo que ambos trabalhem juntos.
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.
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
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.instantiateStreaming()
function is the primary API for compiling and instantiating WebAssembly code, returning both a Module
and its first Instance
.WebAssembly.
Memory
object is a resizable {{jsxref("Global_objects/ArrayBuffer", "ArrayBuffer")}} that holds the raw bytes of memory accessed by an Instance
.WebAssembly.
Table
object is a resizable typed array of opaque values, like function references, that are accessed by an Instance
.CompileError
object.LinkError
object.RuntimeError
object.Especificação | Estado | Comentário |
---|---|---|
{{SpecName('WebAssembly JS')}} | {{Spec2('WebAssembly JS')}} | Initial draft definition of the JavaScript API. |
{{Compat("javascript.builtins.WebAssembly")}}