Wasmer 2.0 is now available, a toolkit for creating applications based on WebAssembly.

The second major release of the Wasmer project has occurred, developing a runtime for executing WebAssembly modules that can be used to create universal applications capable of running across different operating systems, as well as for the isolated execution of untrusted code. The project's code is written in Rust and is distributed under the MIT license.

Portability is ensured through the compilation of application code into low-level WebAssembly bytecode, which can run on any OS or be embedded in programs written in other programming languages. Programs are lightweight containers in which WebAssembly pseudocode is executed. These containers are not tied to the operating system and can include code originally written in any programming language. The Emscripten toolkit can be used for compiling to WebAssembly. Various compilation backends (Singlepass, Cranelift, LLVM) and engines (utilizing JIT or generating machine code) are supported for translating WebAssembly to the machine code of the current platform.

Access management and interaction with the system are provided through the WASI (WebAssembly System Interface) API, which offers interfaces for working with files, sockets, and other functionalities provided by the operating system. Applications are isolated from the main system in a sandbox environment and have access only to the declared functionalities (the security mechanism based on capability management requires that each resource (files, directories, sockets, system calls, etc.) must be granted corresponding permissions for the application to act on them).

To run a WebAssembly container, it is sufficient to install the Wasmer runtime on your system, which comes without external dependencies ("curl https://get.wasmer.io -sSfL | sh"), and run the necessary file ("wasmer test.wasm"). Programs are distributed as regular 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 programs written in Rust, C/C++, C#, D, Python, JavaScript, Go, PHP, Ruby, Elixir, and Java.

The platform enables application performance close to that of native builds. Using the Native Object Engine for the WebAssembly module, you can generate machine code ("wasmer compile --native" to generate precompiled object files .so, .dylib, and .dll), which requires minimal runtime to execute while retaining all sandbox isolation capabilities. Precompiled programs with integrated Wasmer can be provided. Rust API and Wasm-C-API are available for creating plugins and extensions.

The significant version change of Wasmer is associated with introducing breaking changes to the internal API, which, according to the developers, will not affect 99% of the platform's users. Additionally, the breaking changes include a modification to the format of serialized Wasm modules (modules serialized in Wasmer 1.0 will not be usable in Wasmer 2.0). Other changes:

  • Support for SIMD (Single Instruction, Multiple Data) instructions, enabling parallel processing of data. Areas where SIMD can significantly enhance performance include machine learning, video encoding and decoding, image processing, physical process simulation, and graphics manipulation.
  • Support for reference types, allowing Wasm modules to reference information in other modules or in the underlying environment.
  • Significant performance optimization has been achieved. The speed of the LLVM runtime with floating-point numbers has increased by about 50%. Function calls are notably faster due to a reduction in situations requiring kernel access. The performance of the Cranelift code generator has increased by 40%. The time for data deserialization has been reduced.
    Wasmer 2.0 is now available, a toolkit for creating applications based on WebAssembly.
    Wasmer 2.0 is now available, a toolkit for creating applications based on WebAssembly.
  • To better reflect their essence, engine names have been changed: JIT → Universal, Native → Dylib (Dynamic Library), Object File → StaticLib (Static Library).

Source: opennet.ru

Buy reliable website hosting with DDoS protection, VPS VDS servers 🔥 Buy reliable website hosting with DDoS protection, VPS VDS servers | ProHoster