WebAssembly:
The Beginning of a New Era

A great future is waiting for the Web. A couple of weeks ago Brendan Eich, an American technologist and creator of the JavaScript programming language, announced that cross-browser work has begun creating a new binary syntax for safe low-level code that will work better than JavaScript. Google, Microsoft, Mozilla, and some tech experts are working together on a project at the W3C WebAssembly Community Group that could be the next big thing.

WebAssembly is a new intermediate representation of Web safe coding. It should serve as a common object-level format for multiple source-level programming languages.

Talking in general, WebAssembly is:

  • An improved JavaScript: you can implement all the critical things on the “wasm” (short for WebAssembly) and import them as a standard JavaScript module.
  • A new programming language: WebAssembly can be defined as an abstract syntax tree (like JavaScript) in a binary format. You can write code and fix errors in text format and WebAssembly can be easily read.
  • An improvement for browsers: Browsers will understand a binary format which means developers will be able to compile binaries which can be compressed to a greater extent than text files used today with JavaScript. The smaller a file is, the faster the download is. WebAssembly code can be transferred and run faster than JavaScript.
  • A target compilation: other languages will get a first-class binary support through the entire web platform stack.

WebAssembly allows users to work with a simple, low-level code blocks that can be used to program anything.

Why do we need WebAssembly?

Asm.js is great, but once engines optimize for it, the parser becomes very hot, especially on mobile devices. Once browsers can support the WebAssembly syntax natively, JavaScript and wasm can diverge, without introducing unsafe or inappropriate features into JS just for use by compliers that are sourcing a few different programming languages.

What will WebAssembly be used for?

Among the other things described above, WebAssembly can be used for simple operations with threads and SIMD (single instruction, multiple data) – in other words, with a single instruction and multiple data. You can put in place a number of data blocks and then write a command code for simultaneous work.

In these cases, you can forget about the object system, “garbage collectors” and dynamic query processing. Just put all of the data streams into a queue and effectively deal with them.

WebAssembly should fill the gaps that exist in the functionality of JavaScript. Many developers can confirm that JavaScript has functionality gaps and this is not a secret. Even the most dedicated fans of JavaScript won’t argue that sometimes the language is trying to “swallow” too much and in doing so it is losing its flexibility and efficiency. Brendan Eich thought that this issue could be solved by adding some new functionality to JavaScript but has found that it would be better with a new format.

Brendan Eich, creator of the JavaScript, former CEO and CTO of Mozzila
Brendan Eich, creator of the JavaScript, former CEO and CTO of Mozzila

WebAssembly can increase the speed of JavaScript by many times. It will also add the things that most JS developers do not want to see in JavaScript. We mean by this is that they need these features, but there is no place for them in JavaScript. Especially taking in mind the fact that we can get these features by using a compilation from some other programming languages. In fact, WebAssembly provides us an alternative compiler that is created specifically for this purpose.

So WebAssembly is an excellent idea for developers who are starting to work with new programming languages and a great new future is waiting for the network and the Web. So it’s better for developers to get out of the shadows and take up the challenge, while it’s not too late to be fist in the game.

Source