⬆️ ⬇️

Portable Native Client support appeared in Chrome. Who will win the race for native speed - PNaCl or Asm.js?

Google has finally released a portable version of the Native Client (PNaCl). The Native Client technology, which allows compiling into machine code and executing C or C ++ programs in the browser, achieving almost native performance, was often criticized for not supporting all platforms from the very beginning, and for each of them it was necessary to compile separately. PNaCl compiles the source code of the program into the LLVM bitcode - a low-level virtual machine that supports multiple hardware platforms and ensures that the code will work almost everywhere.



PNaCl support is disabled by default. In order to enable it, you need to run Chrome with the --enable-pnacl and / or --enable-nacl .



Development of the Native Client has been going on for several years, and during this time, this technology has a strong Mozilla competitor - Asm.js. Asm.js does not compile into bytecode, but into a limited subset of JavaScript, which is very well optimized and compiles into native code before execution, allowing you to achieve only half the native output. At the same time, the Asm.js code is a valid JavaScript program, and can be run in any browser, even without Asm.js support. It seems that in the next few years, NaCl and Asm.js will coexist and compete with each other.


')

Source: https://habr.com/ru/post/180117/



All Articles