MDN wants to talk to developers like you: https://qsurvey.mozilla.com/s3/8d22564490d8

WebAssembly

Tradução em progresso.

This is an experimental technology
Because this technology's specification has not stabilized, check the compatibility table for usage in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the specification changes.

O WebAssembly é um novo tipo de código que pode ser executado em browsers modernos — se trata de uma linguagem de baixo nível como assembly, com um formato binário compacto que executa com performance quase nativa e que fornece um novo alvo de compilação para linguagens como C/C++, para que possam ser executadas na web. Também foi projetado para executar em conjunto com o JavaScript, permitindo que ambos trabalhem juntos.

Em poucas palavras

O WebAssembly tem enormes implicações para a plataforma web — ele irá fornecer uma maneira de executar na web código escrito em diversas linguagens em velocidade quase nativa, com apps que não conseguiriam fazer isso antes.

O WebAssembly foi projetado para complementar e executar lado a lado com JavaScript — usando as APIs JavaScript do WebAssembly, você pode carregar módulos WebAssembly em uma aplicativo JavaScript e compartilhar funcionalidade entre ambos. Isso permite que você aproveite o desempenho e poder da WebAssembly e a expressividade e flexibilidade do JavaScript nos mesmos aplicativos, mesmo que você não saiba como escrever código de WebAssembly.

E o que é ainda melhor é que ele está sendo desenvolvido como um web standard através da W3C WebAssembly Community Group com participantes ativos de todos os principais fornecedores de browsers.

Guias

WebAssembly concepts
Get started by reading the high-level concepts behind WebAssembly — what it is, why it is so useful, how it fits into the web platform (and beyond), and how to use it.
Compiling from C/C++ to WebAssembly
When you’ve written code in C/C++, you can then compile it into .wasm using a tool like Emscripten. Let’s look at how it works.
Loading and running WebAssembly code
After you have a .wasm, this article covers how to fetch, compile and instantiate it, combining the WebAssembly JavaScript API with the Fetch or XHR APIs.
Caching compiled WebAssembly modules
Caching large WebAssembly modules on the client is useful for improving app startup performance. This article explains how to use this using IndexedDB.
Using the WebAssembly JavaScript API
Once you've loaded a .wasm module, you'll want to use it. In this article we show you how to use WebAssembly via the WebAssembly JavaScript API.
Exported WebAssembly functions
Exported WebAssembly functions are the JavaScript reflections of WebAssembly functions and allow calling WebAssembly code from JavaScript. This article describes what they are.
Understanding WebAssembly text format
This article explains the wasm text format. This is the low-level textual representation of a .wasm module shown in browser developer tools when debugging.
Converting WebAssembly text format to wasm
This article provides a guide on how to convert a WebAssembly module written in the text format into a .wasm binary.

Referência da API

WebAssembly
This object acts as the namespace for all WebAssembly related functionality.
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, cached in IndexedDB, and instantiated multiple times.
WebAssembly.Instance
A WebAssembly.Instance object is a stateful, executable instance of a ModuleInstance objects contain all the Exported WebAssembly functions that allow calling into WebAssembly code from JavaScript.
WebAssembly.instantiate()
The WebAssembly.instantiate() function is the primary API for compiling and instantiating WebAssembly code, returning both a Module and its first Instance.
WebAssembly.Memory()
A WebAssembly.Memory object is a resizable 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.CompileError()
Creates a new WebAssembly CompileError object.
WebAssembly.LinkError()
Creates a new WebAssembly LinkError object.
WebAssembly.RuntimeError()
Creates a new WebAssembly RuntimeError object.

Exemplos

Especificações

Specification Status Comment
Web Assembly JavaScript API Rascunho Initial draft definition of the JavaScript API.

Compatibilidade do navegador

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support 57 Não suportado 52 (52)[1] Não suportado (Yes) Não suportado
Feature Chrome for Android Android Webview Edge Mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Safari Mobile
Basic support 57 57 Não suportado 52.0 (52)[1] Não suportado Não suportado Não suportado

[1] WebAssembly is enabled in Firefox 52+, although disabled in the Firefox 52 Extended Support Release (ESR.)

Veja também

Etiquetas do documento e colaboradores

Etiquetas: 
 Colaboradores desta página: AlanCezarAraujo
 Última atualização por: AlanCezarAraujo,