Draft WebAssembly 2.0 standard released 

The W3C unveiled Recently through a post a draft of a new specification that standardizes the preparation code of WebAssembly 2.0 and associated API to enable the creation of high-performance applications that are portable across browsers and hardware platforms.

For those new to WebAssembly, you should know that this provides a generic middleware, low level and browser-independent, to run compiled applications from various programming languages. By using JIT for WebAssembly, you can achieve a level of performance close to native code.

About WebAssembly

WebAssembly can be used to perform high-performance tasks in the browser, such as video encoding, audio processing, 3D and graphics manipulation, game development, cryptographic operations, and mathematical calculations, by executing code written in compiled languages ​​such as C/C++.

Among the main tasks of WebAssembly is the provision of portability, predictability of behavior and identity of code execution on different platforms. Recently, WebAssembly has also been promoted as a universal platform for safe code execution on any infrastructure, operating system, and device, not limited to browsers.

About the WebAssembly 2.0 draft

On the part of the changes that have been made since WebAssembly are the finished proposals for WebAssembly 2.0 are fixed-width SIMD, mass memory operations, reference types, JavaScript BigInt support for WebAssembly i64, support for multiple return values and import/export of mutable global variables.

The W3C has published three draft WebAssembly 2.0 specifications:

  1. Web Assembly Core: describes a low-level virtual machine for running intermediate WebAssembly code. Resources related to WebAssembly come in a ".wasm" format, similar to Java ".class" files, which contain static data and code segments to work with that data.
  2. WebAssembly JavaScript interface: provides an API for integration with JavaScript. Allows you to get values ​​and pass parameters to WebAssembly functions. WebAssembly execution follows the JavaScript security model, and all interaction with the host is performed in a manner similar to running JavaScript code.
  3. WebAssembly Web API: defines an API based on the Promise mechanism for requesting and executing ".wasm" resources. The WebAssembly resource format is optimized to start execution without waiting for the file to fully download, which improves the responsiveness of web applications.

Differences between WebAssembly and WebAssembly 2.0

Also, it should be noted that there are some important changes in WebAssembly 2.0 compared to the first version of the standard:

  • v128 vector type support and related vector instructions that allow you to perform operations on multiple numeric values ​​in parallel (SIMD, single instruction, multiple data).
  • Ability to import and export mutable global variables, which allows global binding for values ​​as stack pointers in C++.
  • New instructions to convert float to int, which instead of throwing an exception on result overflow, returns the minimum or maximum possible value (required for SIMD).
  • Instructions for expanding the sign of integers (increase the bit depth of a number keeping the sign and value).
  • Support for returning multiple values ​​by blocks and functions (Plus multiple pass parameters to functions).
  • Implement the JavaScript functions BigInt64Array and BigUint64Array to convert between the JavaScript type BigInt and the WebAssembly representation of 64-bit integers.
  • Support for reference types (funcref and externref) and their associated statements (select, ref.null, ref.func, and ref.is_null).
  • memory.copy, memory.fill, memory.init, and data.drop instructions to copy data between memory regions and delete 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 to copy/fill tables in batch mode (table.copy, table.init and elem.drop).

Finally, if you are interested in knowing more about it, you can consult the details In the following link.


The content of the article adheres to our principles of editorial ethics. To report an error click here!.

Be the first to comment

Leave a Comment

Your email address will not be published.

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.