Wasmer 1.0, a toolkit for platform agnostic WebAssembly applications

After two years of development published the first significant release of the project Wasmer , which develops a runtime for executing WebAssembly modules. The areas of use for Wasmer include the creation of universal applications that can run on different operating systems, as well as the organization of isolated execution of untrusted code. Including
building server-side applications is supported, for example, demonstrating running an Nginx server compiled into WebAssembly. The project code is written in Rust and is distributed under the MIT license.

Portability is ensured by compiling the application code into a low-level intermediate WebAssembly code that can run on any OS or be embedded in programs in other programming languages. Programs are lightweight containers that execute WebAssembly pseudocode. These containers are not tied to the operating system and can include applications originally written in any programming language. The Emscripten toolkit can be used to compile to WebAssembly. Various frameworks such as LLVM and the Cranelift code generator are plugged in to translate WebAssembly to machine code on the current platform.

Access control and interaction with the system is provided using the WASI (WebAssembly System Interface) API, which provides APIs for working with files, sockets and other functions provided by the operating system. Applications are isolated from the main system in a sandbox environment and have access only to the declared functionality (security mechanism based on managing capabilities – for actions with each of the resources (files, directories, sockets, system calls, etc.), the application must be given the appropriate powers).

To run a WebAssembly container, it is enough to install runtime Wasmer on the system, which is supplied without external dependencies (” curl https://get.wasmer.io -sSfL | sh “) and run the required file (” wasmer test.wasm “). Programs are distributed in the form of regular WebAssembly modules, which can be managed using the WAPM package manager. Wasmer is also available in the form of a library that can be used with various programming languages. Embedding WebAssembly code into programs in Rust, C / C ++, C #, D, Python, JavaScript, Go, PHP, Ruby, Elixir, and Java is supported.

Some of the features of Wasmer 1.0 are:

  • High performance of executable applications, close to the execution of native assemblies, and high compilation speed.
  • Extensible architecture with the ability connecting different compilation backends ( Singlepass

/Release. View in full here.