MyPage is a personalized page based on your interests.The page is customized to help you to find content that matters you the most.


I'm not curious

WebAssembly and The Faster Web

Published on 19 January 16
0
0
WebAssembly or wasm for short is a new binary format that is launched in collaboration between Webkit Projects and the major internet browsers. Regarded as the evolution of the asm.js, the WebAssembly will be used for performance critical codes and to compile other languages like C/C++ to the web platform.
WebAssembly and The Faster Web - Image 1
Specially tailored for JavaScript programmers, the new WebAssembly format allows programmers to compile their code on internet browsers such Google and Mozilla and then run it under JavaScript. As quoted by Microsoft’s Scott Hanselman, JavaScript is dubbed as the Assembly language for the web. And JavaScript users will have something to cheer about when the four major browser engines including Microsoft, Google, Mozilla and Apple are providing a bytecode for the JavaScript source through WebAssembly.
Bytecode
WebAssembly is designed to be a portable bytecode which is efficient for browsers to download, load and compile. This is because WebAssembly runs on native machine types such as 32-bit integers and it is versatile enough to support SIMD instruction sets like SSE and AVX.
Wasm’s Notation
Wasm will have a binary notation that compilers can produce, and a corresponding text notation that will be apt for both debuggers and developers. Also, one key potential benefit of Wasm’s binary representation is that it is 20 times quicker to parse than the equivalent asm.js.
Advantages for you
In essence, our JavaScript files are downloaded from the server and subsequently parsed and collected by the JavaScript engine in the web browser. What WebAssembly can do for you is to initiate a dominant binary format that can compress greater amount of codes (significantly more than the standard JavaScript text files) and runs your JavaScript engines faster since it is decoding the binary format.

Basically, the concept of asm.js is to code JavaScript programming language in a very speedy fashion. And the results are stunning, for instance if you compile a C++ to asm.js, you can actually reach 70% of native speed in web browsers. Also, if you talking about videos or even video games for that matter, Performance Critical Functionality can be simply executed via WebAssembly by hand-coding in the program. Another point, outside coding languages such as C can be seamlessly ported to the web platform as well.

Furthermore, as WebAssembly is a good compilation target for other languages, it can be added to ES6 to support asm.js well through Math.fround(x) rounds x to a 32 bit float and Math.imul(x,y) multiplies the two integers x and y.
Lastly, as wasm’s binary format is to provide asm.js code, the 2 advantages of the format are faster loading and a simpler use for JavaScript.
Key points to note
  • You are able to debug the WebAssembly Binary through its source code. This function is a development of the source maps which runs quite similarly to JavaScript.
  • WebAssembly binaries can encode abstract syntax trees as they differ from the usual stack or register-based bytecode.
  • WebAssembly provides you with the definitive compilation target for the web and would soon be the newest web standard that’s implemented in all browsers.
  • Wasm can mimic the semantics of the binaries and hold a chunk of statements and expressions because of its text format.
What’s going to happen?
The collaborated effort was to plan a launch of the so-called polyfill library that will translate WebAssembly code into JavaScript so that it can run in any browser, including those without a native WebAssembly support. Eventually, Webkit project and the major browsers will be able to build more tools and to support even more languages such as C# and Ruby.
However, Brendan Eich, inventor of JavaScript and CEO of Mozilla stated that once the main browsers support the new format natively, JavaScript and WebAssembly will be separated again. He emphasized that the objective of the project is not to replace JavaScript but to allow even more programming languages to be compiled for the Web.

The novel part of this whole project is that we don’t normally see major browser engines collaborating together on a scale like this.
This blog is listed under Development & Implementations Community

Related Posts:
Post a Comment

Please notify me the replies via email.

Important:
  • We hope the conversations that take place on MyTechLogy.com will be constructive and thought-provoking.
  • To ensure the quality of the discussion, our moderators may review/edit the comments for clarity and relevance.
  • Comments that are promotional, mean-spirited, or off-topic may be deleted per the moderators' judgment.
You may also be interested in
 
Awards & Accolades for MyTechLogy
Winner of
REDHERRING
Top 100 Asia
Finalist at SiTF Awards 2014 under the category Best Social & Community Product
Finalist at HR Vendor of the Year 2015 Awards under the category Best Learning Management System
Finalist at HR Vendor of the Year 2015 Awards under the category Best Talent Management Software
Hidden Image Url

Back to Top