Wasmer 3.0 is now available, a toolkit for building applications based on WebAssembly.

The third major release of the Wasmer project has been introduced, developing a runtime for executing WebAssembly modules that can be used to create universal applications capable of running on 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.

The ability to run a single application on different platforms is provided by compiling the code into low-level intermediate WebAssembly code, which can run on any OS or be embedded in programs written in other programming languages. Programs are lightweight containers in which WebAssembly pseudocode executes. 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 compilation to WebAssembly. For translating WebAssembly into machine code for the current platform, different compilation backends (Singlepass, Cranelift, LLVM) and engines (utilizing JIT or generating machine code) are supported.

Applications are isolated from the main system in a sandbox environment and have access only to the declared functionality (a security mechanism based on capability control — the application must be granted appropriate permissions for actions with each resource such as files, directories, sockets, system calls, etc.). Access control and interaction with the system are provided via the WASI (WebAssembly System Interface) API, which offers programming interfaces for working with files, sockets, and other functions provided by the operating system.

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.

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.

Key changes in Wasmer 3.0:

  • The ability to create native executable files for all platforms has been added. The "wasmer create-exe" command has been completely redesigned to convert a file with intermediate WebAssembly code into self-contained executable files for Linux, Windows, and macOS platforms, which can run without installing Wasmer itself.
  • Support has been provided for running WAPM packages hosted in the wapm.io directory using the "wasmer run" command. For example, executing "wasmer run python/python" will load the python package from the wapm.io repository and run it.
  • The Wasmer Rust API has been completely revamped, modifying the memory handling style and allowing for the safe storage of Wasm objects within the Store structure. A new MemoryView structure has been proposed, enabling reading and writing data in a linear memory space.
  • A set of wasmer-js components has been implemented to run Wasmer in a web browser and interact with it from JavaScript, using the wasm-bindgen library. The capabilities of wasmer-js correspond to those of wasmer-sys components, which are designed to run Wasmer on standard operating systems.
  • Engines have been simplified. Instead of separate engines for JIT, dynamic, and static linking (Universal, Dylib, StaticLib), there is now a single unified engine, where code loading and saving are managed at the parameter setup level.
  • The rkyv framework is utilized for deserializing artifacts, operating in zero-copy mode, meaning no additional memory allocation is required, and it performs deserialization using only the originally provided buffer. The application of rkyv has significantly increased launch speed.
  • The Singlepass compiler has been improved, now supporting functions with multiple arguments (multi-value), enhancing reliability and adding support for exception handling frames.
  • The implementation of the WASI (WebAssembly System Interface) API has been improved. Issues in the WASI interface for filesystem operations have been resolved. Internal types have been reworked using WAI (WebAssembly Interfaces), which will enable a series of new capabilities in the future.

Source: opennet.ru

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