What is WebAssembly?

What is WebAsssembly? What does it mean for JavaScript? Read this article to find the answer!

What is WebAssembly?

  1. JavaScript improvements : Deploy important work in wasm and import it as a standard JavaScript module.
  2. A new language: Code WebAssembly defines an AST (abstract syntax tree - Abstract Syntax Tree) expressed in binary form. You can write author and debug (debug) in readable text format.
  3. Improved browser: Browsers will understand binary format, meaning that it is possible to compile compressed binary packages smaller than the JavaScript segment used today. The smaller payload will be delivered faster. Depending on the job   Optimize compile time, WebAssembly packages can run faster than JavaScript.
  4. A Compile Target: A way for other languages ​​to get the best binary support on the entire web platform.

What is WebAssembly? Picture 1What is WebAssembly? Picture 1

What does WebAssembly mean for JavaScript?

We need WebAssembly because it's as flexible as JavaScript. Currently, it is difficult to express many things in JavaScript and the simplified features can create complexity for a language that confuses many users.

WebAssembly provides access to a set of low-level basic blocks that people can use to build anything imaginable. So how is it different from JavaScript? The keyword here is low, it defines primitive database types, typefaces, traffic control, etc. These are simple, non-systematic databases. complex objects (prototypal or other systems), no garbage collector is automatically integrated.

So what is the WebAssembly configuration ?

WebAssembly defines abstract syntax tree stored in binary form. The binary format is great because it means we can create smaller application packages. Probably many people will wonder how to debug a binary language format.

Fortunately, the developers that are creating have a debugger that will definitely appear in the browser, the abstract syntax tree will be shown in a friendly (moderate) text format.

What is the WebAssembly used for?

WebAssembly easily expresses things like thread and SIMD (Single Instruction, Multiple Data), you can queue multiple blocks of data side by side and call a single command to activate at the same time. That means it is possible to receive parallel processing paths for real-time video stream effects.

  1. 4 ways to write multi-threaded code in Java

With WebAssembly, developers can forget about object systems, garbage collectors and all other things, just queue up some raw bits in small rows and process them as quickly as possible.

Games, VR and virtual reality enhancements are clear examples. Most current WebAssembly demos use Unity or Unreal Engine, both support asm.js compilation. Music production applications like Ableton Live and video production applications like Adobe Premier Pro are still a bit awkward when switching to the web; and there are still many issues to be addressed, such as ensuring better time for data-intensive real-time applications.

WebAssembly brings diverse languages into Web platforms

WebAssembly offers what most developers JS must agree that we don't need in JavaScript. They need them not for JavaScript code but to support compilation from other languages ​​using them.

  1. Security in web language

WebAssembly provides an alternative compile target, designed specifically for that purpose. Now, it's easier to export code that relies heavily on features like shared memory streams. The process of writing a compiler for WebAssembly is less complicated than writing a compiler for JavaScript, simply because there is a better map for the target AST.

It's great to know that all the old languages ​​we know and love will run on the web platform right now.

See also: What is Java? Why choose Java?

4 ★ | 1 Vote