WebAssembly support lands in Go language: golang wasm/js

WebAssembly adoption has really picked up in the first quarter of 2018. Many languages are now targeting the binary format that is the first native alternative to JavaScript since the inception of the web. The Go programming language is now joining the wasm extravaganza.

Support for Golang on the Wasm platform will be added in a series of commits to the golang base. The first in the series landed on March 31st 2018, and aims to add WebAssembly as an architecture target to the Go programming language.

The package is split into various parts, the GOARCH moniker for the platform is wasm, augmented with GOOS valued js, which represents that the compiled binaries will run in environments where JavaScript runs in browsers and the Node.js server side environment.

Golang apps compiled to wasm will have interoperability with JavaScript applications. This means that WebAssembly targeting wasm architecture will largely be accessed and embedded from within JavaScript in the environment. Wasm however, not tied to the web platform:

While WebAssembly is designed to run on the Web, it is also desirable for it to be able to execute well in other environments, including everything from minimal shells for testing to full-blown application environments e.g. on servers in datacenters, on IoT devices, or mobile/desktop apps. It may even be desirable to execute WebAssembly embedded within larger programs.

- Non-Web Embeddings [of WebAssembly]

The underpinnings of running Golang on the Wasm architecture contain a number of technical specifications. This includes details in memory management, 32/64 bit architecture functionality, threads, garbage collection and JavaScript interoperation.

Details are described in minute detail in the online document: WebAssembly architecture for Go