Firefox 52 released with WebAssembly support


    3D rendering of the Zen Garden demo in Firefox 52 with WebAssembly support

    Mozilla has released Firefox 52 , the latest version of the browser with support for the Windows XP operating system. A number of important changes were made : connection to hotspots was simplified, where you first need to log in to the browser, danger warnings appeared, if the page requests a password for an unsafe connection (not HTTPS), NPAPI plug-in support is gone (except for Flash, and full support will remain in ESR build) , closed 28 vulnerabilities .

    But nothing compares to the main and fundamental innovation - support for low-level programming language WebAssembly (wasm) of an assembler type, which is calledone of the most significant innovations of the web platform over the past decade. This is what JavaScript was missing.

    WebAssembly



    The developers explain why it was necessary to create a WebAssembly . The fact is that JavaScript was originally conceived as a lightweight language for simple scripts. No one imagined what it would grow into and how it would be used. It was invented for beginners in programming - for simple things like writing a form on a web page.

    Since then, much has changed. Modern web applications are complex computer programs with client and server code, most of which is written in JavaScript. Despite the progress in the development of JavaScript itself and all the attempts of developers to create effective engines for fast execution of JavaScript, nothing happened, it is simply physically impossible. JavaScript has inherent limitations. The browser simply cannot execute this code at least approximately as fast as the native code in the operating system.

    Mozilla first matured to develop a kind of virtual machine in a browser where you can run low-level code - and released asm.js a few years ago (Google experimented with the Native Client API). Sublanguage asm.js proved itself so well that it became clear: you need to join forces with all the major development companies for a joint project that will move the web forward.

    Low-level language WebAssembly can work in conjunction with JavaScript and allow web applications to run with much higher performance — almost like native applications in the operating system.

    Now the browser can run with high-performance 3D games, computer-aided design (CAD) systems, video editors, graphic editors, scientific visualizations, demanding calculations, video encoding - anything.

    Over time, many existing web applications - mail, social networks, text editors - and JavaScript frameworks are more likely to start using WebAssembly, which will significantly increase the download speed and greatly increase their performance during operation.

    Unlike other Flash-like approaches that require plug-in installation in a browser to run applications at a speed comparable to native applications, WebAssembly fits perfectly into a standard web platform. It is an open and compatible standard integrated into browsers. This means that developers can integrate WebAssembly libraries for CPU-intensive calculations (compression, face detection, physics) directly into existing web applications that use JavaScript.

    WebAssembly is an open standard developed by Mozilla, Google, Microsoft and Apple. As you can see, this group represents the developers of the four most common browsers, so you can count on becoming wasm as a universal standard. Google promises to implement WebAssembly support in the next version of Chrome (57), Microsoft is already working on implementation in Edge.

    Low-level language will become a kind of addition to JavaScript and eventually it should work wherever JS works: in all browsers and in all runtimes like Node.js.

    Who will benefit from using WebAssembly? It is not only about writing new applications on wasm. Through compilers like Emscriptenwhole games and ready-made native applications can be ported to the web. Ported C / C ++ code using this compiler will be executed in the browser at almost the same speed as the native application. In addition to C / C ++, preliminary support for WebAssembly is also implemented for the Rust programming language.

    For example, you can play the Zen Garden demo (Firefox 52 is required, currently only the desktop version is supported).


    JavaScript functions will call WebAssembly functions and vice versa. That is, it is possible within the framework of a single program to write in a high-level JavaScript language and, at times, switch to C / C ++ / Rust as needed.

    Developers will begin to distribute and reuse low-level WebAssembly modules without the need to understand their device, as they now use minified JavaScript libraries.

    Mozilla states that in terms of code reuse and software architecture, the wall between native and web applications is starting to break down, and this is just the beginning. Developer tools, debuggers and compilers will continue to evolve, as well as compatibility, performance, and WebAssembly functionality. For example, now in terms of Mozilla - to implement support for multithreading and concurrency SIMD.

    “In a sense, WebAssembly changes what a web developer means,” writes David Bryant, head of platform development at Mozilla, “as changes the fundamental properties of the web.”

    In fact, now programs in C / C ++ have become possible to port for execution in the browser, and in the near future the same can be done for the languages ​​in which mobile applications are written - Java, Swift, C #. All of them will become compatible with the standard web platform. It turns out that in a sense, all programmers will eventually become web developers.

    Also popular now: