A preliminary version of the WebAssembly 2.0 standard is now available.

The W3C consortium has published a draft of a new specification standardizing the intermediate code WebAssembly 2.0 and its related API, which allows the creation of high-performance applications that can be ported across browsers and hardware platforms. WebAssembly provides a browser-independent universal low-level intermediate code for running applications compiled from various programming languages. By utilizing JIT, WebAssembly can achieve performance levels close to native code.

WebAssembly technology can be used to perform tasks in the browser that require high performance, such as video encoding, audio processing, graphics manipulation, 3D rendering, game development, cryptographic operations, and mathematical computations by organizing the execution in the browser of code written in compiled languages like C/C++.

Among the main tasks of WebAssembly is to ensure portability, predictability of behavior, and execution identity of code across different platforms. Recently, WebAssembly is also being promoted as a universal platform for safely executing code in any infrastructure, operating system, and devices, not limited to browsers.

W3C has published three preliminary specifications for WebAssembly 2.0:

  • 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 Interface — provides an API for integration with JavaScript. It allows for retrieving values and passing parameters to WebAssembly functions. The execution of WebAssembly aligns with the security model of JavaScript, and all interaction with the host system is conducted similarly to the execution of 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.

The main changes in WebAssembly 2.0 compared to the first version of the standard are:

  • Support for the vector type v128 and associated vector instructions that allow for parallel operations on multiple numerical values (SIMD, single instruction multiple data).
  • The ability to import and export mutable global variables, allowing for global binding for values such as stack pointers in C++.
  • New instructions for converting float to int, which instead of generating an exception on overflow return the minimum or maximum possible value (necessary for SIMD).
  • Instructions for sign extension of integers (increasing the bit width of the number while preserving sign and value).
  • Support for returning multiple values in blocks and functions (in addition to passing multiple parameters to functions).
  • Implementation of JavaScript functions BigInt64Array and BigUint64Array for conversion between the JavaScript type BigInt and the representation of 64-bit integers in WebAssembly.
  • Support for reference types (funcref and externref) and related instructions (select, ref.null, ref.func, and ref.is_null).
  • Instructions memory.copy, memory.fill, memory.init, and data.drop for copying data between memory regions and clearing memory regions.
  • Instructions for direct access and modification of tables (table.set, table.get, table.size, table.grow). Ability to create, import, and export multiple tables in one module. Functions for copying/filling tables in batch mode (table.copy, table.init, and elem.drop).

Source: opennet.ru

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