The WebAssembly 3.0 standard has been published

The W3C consortium has announced the readiness of a specification standardizing the WebAssembly 3.0 intermediate code and its associated API, which allows for the creation of high-performance applications that are portable across browsers and hardware platforms. WebAssembly provides a browser-independent universal low-level intermediate code for executing applications compiled from various programming languages.

The WebAssembly technology can be utilized in the browser for tasks that require high performance, such as video encoding, audio processing, graphics manipulation, 3D, game development, cryptographic operations, and mathematical calculations by enabling the execution in the browser of code written in compiled languages like C/C++. By utilizing JIT for WebAssembly, performance levels close to native code can be achieved.

Among the main tasks of WebAssembly are ensuring portability, predictability of behavior, and identity of code execution across different platforms. WebAssembly is not limited to browsers and is also promoted as a universal platform for secure execution of code in any infrastructure, operating systems, and devices.

The following specifications are available:

  • WebAssembly Core — describes a low-level virtual machine for executing WebAssembly intermediate code. WebAssembly-related resources are supplied in the ".wasm" format, similar to ".class" files in Java, containing static data and code segments for working with that data.
  • WebAssembly JavaScript API — provides an API for integration with JavaScript. It allows for retrieving values and passing parameters to WebAssembly functions. The execution of WebAssembly adheres to the security model of JavaScript, and all interactions with the host system are done similarly to executing JavaScript code.
  • WebAssembly Web API — defines a programming interface based on the Promise mechanism for requesting and executing ".wasm" resources. The format of WebAssembly resources is optimized for starting execution without waiting for the entire file to load, which improves the responsiveness of web applications.
  • WASI API — defines a modular system interface for running WebAssembly outside of browsers and providing access to resources such as files, network connections, pseudorandom number generators, and system clocks.

It is noted that the new version of the standard significantly improves support for compiling high-level languages to WebAssembly. For example, the ability to compile projects in languages such as Java, OCaml, Scala, Kotlin, Scheme, and Dart into WebAssembly has been implemented. Key changes in WebAssembly 3.0, compared to the second version of the standard:

  • Support for a 64-bit address space has been implemented. The i64 type can now be used for memory addressing, rather than only i32, which expands the addressable space for applications from 4 GB to 16 EB (with a limit of 16 GB when running in a browser).
  • The ability to use multiple memory objects simultaneously in a single WebAssembly module and to work with different address spaces has been provided. Among other things, it is possible to copy data between different instances of memory objects located in different address spaces.
  • Support for garbage collection has been added. In addition to the previously available linear memory, a separate type of storage that is automatically managed by a garbage collector has been introduced. The compiler can now use separate data structures, arrays, and variables, for which WebAssembly is responsible for memory allocation and lifecycle management.
  • Support for typed references has been added, which can describe the exact structure of the value to which the reference points, allowing for the avoidance of additional runtime checks. Subtypes, type recursion, and the safe use of function references that do not require type and boundary checks at runtime are supported.
  • Support for tail calls has been added, where the current function immediately completes execution after calling another function, without consuming stack space.
  • Support for exception handling has been added.
  • Support for 'relaxed' vector SIMD instructions has been added, allowing for higher performance by foregoing strict adherence to semantics across all hardware platforms.
  • Support has been added for a deterministic execution profile that defines platform-independent behavior for instructions whose execution results may differ across platforms (floating-point operations, returning NaN, weakened vector instructions). When this profile is selected, Wasm ensures deterministic behavior, reproducibility, and portability.
  • A syntax for creating custom annotations has been added, allowing additional information to be attached to WebAssembly code. Previously, support for custom sections that store arbitrary information existed in the binary format of WebAssembly, but was missing in the textual format. Now, there is the possibility to add this information in a readable and editable format.
  • Built-in functions for working with strings have been added to the JavaScript API. Previously, JavaScript strings could only be passed to WebAssembly as external references, but now they can be directly accessed and manipulated within WebAssembly.

Source: opennet.ru

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