Wasmer 2.0, a toolkit for building WebAssembly-based applications, is available

This is the second major release of the Wasmer project, which develops a runtime for executing WebAssembly modules that can be used to create universal applications that can run on different operating systems, as well as to run untrusted code in isolation. The project code is written in Rust and distributed under the MIT license.

Portability is ensured by compiling the application code into a low-level WebAssembly intermediate code that can run on any operating system or be embedded in programs in other programming languages. Programs are lightweight containers that run WebAssembly pseudocode. These containers are not tied to the operating system and may include code originally written in any programming language. The Emscripten toolkit can be used to compile to WebAssembly. To translate WebAssembly into the machine code of the current platform, it is supported to connect different compilation backends (Singlepass, Cranelift, LLVM) and engines (using JIT or generating machine code).

Access control and interaction with the system is provided using the WASI (WebAssembly System Interface) API, which provides programming interfaces 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 (capability-based security mechanism - for actions with each of the resources (files, directories, sockets, system calls, etc.), the application must be given the appropriate authority).

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

The platform allows you to achieve application execution performance close to that of native assemblies. Using the Native Object Engine for a WebAssembly module, you can generate native code ("wasmer compile -native" for generating precompiled .so, .dylib and .dll object files), which requires minimal runtime to run, but retains all the features of sandbox isolation. It is possible to supply precompiled programs with built-in Wasmer. Rust API and Wasm-C-API are offered for creating add-ons and add-ons.

A significant change in the Wasmer version number is associated with making compatibility-breaking changes to the internal API, which, according to the developers, will not affect 99% of platform users in any way. Among the changes that break compatibility, there is also a change in the format of serialized Wasm modules (modules serialized in Wasmer 1.0 will not be able to be used in Wasmer 2.0). Other changes:

  • Support for SIMD instructions (Single Instruction, Multiple Data), which allow organizing parallelization of data operations. Among the areas in which the use of SIMD can significantly improve performance are machine learning, video encoding and decoding, image processing, simulation of physical processes and graphics manipulation.
  • Support for reference types that allow Wasm modules to access information in other modules or in the base environment.
  • Significant performance optimizations have been made. Speed ​​of LLVM runtime with floating point numbers increased by about 50%. Significantly accelerated function calls by reducing situations that require a call to the kernel. Cranelift code generator performance increased by 40%. Reduced data deserialization time.
    Wasmer 2.0, a toolkit for building WebAssembly-based applications, is available
    Wasmer 2.0, a toolkit for building WebAssembly-based applications, is available
  • To more accurately reflect the essence, the names of the engines have been changed: JIT → Universal, Native → Dylib (Dynamic Library), Object File → StaticLib (Static Library).

Source: opennet.ru

Add a comment