官术网_书友最值得收藏!

  • Learn WebAssembly
  • Mike Rourke
  • 353字
  • 2021-08-13 15:38:47

Google and Native Client

Google developed Native Client (NaCl) with the intent to safely run native code within a web browser. The executable code would run in a sandbox and offered the performance advantages of native code execution.

In the context of software development, a sandbox is an environment that prevents executable code from interacting with other parts of your system. It is intended to prevent the spread of malicious code and place restrictions on what software can do.

NaCl was tied to a specific architecture, while Portable Native Client (PNaCl) was an architecture-independent version of NaCl developed to run on any platform. The technology consisted of two elements:

  • Toolchains which could transform C/C++ code to NaCl modules
  • Runtime components which were components embedded in the browser that allowed execution of NaCl modules:
The Native Client toolchains and their outputs

NaCl's architecture-specific executable (nexe) was limited to applications and extensions that were installed from Google's Chrome Web Store, but PNaCl executables (pexe) can be freely distributed on the web and embedded in web applications. Portability was made possible with Pepper, an open source API for creating NaCl modules, and its corresponding plugin API (PPAPI). Pepper enabled communication between NaCl modules and the hosting browser, and allowed for access to system-level functions in a safe and portable way. Applications could be easily distributed by including a manifest file and a compiled module (pexe) with the corresponding HTML, CSS, and JavaScript:

Pepper's role in a Native Client application

NaCl offered promising opportunities to overcome the performance limitations of the web, but it had some drawbacks. Although Chrome had built-in support for PNaCl executables and Pepper, other major browser did not. Detractors of the technology took issue with the black-box nature of the applications as well as the potential security risks and complexity.

Mozilla focused its efforts on improving the performance of JavaScript with asm.js. They wouldn't add support for Pepper to Firefox due to the incompleteness of its API specification and limited documentation. In the end, NaCl was deprecated in May, 2017, in favor of WebAssembly.

主站蜘蛛池模板: 伊通| 乌兰察布市| 温州市| 开原市| 上饶县| 南阳市| 长葛市| 舞阳县| 四平市| 融水| 武威市| 荔浦县| 壶关县| 左权县| 夏津县| 开原市| 濉溪县| 咸阳市| 昌黎县| 通渭县| 龙岩市| 岢岚县| 晋江市| 云安县| 上饶县| 眉山市| 克东县| 石林| 曲阜市| 西乡县| 柯坪县| 鲜城| 余江县| 滁州市| 定陶县| 吉林市| 蛟河市| 芮城县| 民勤县| 邛崃市| 天等县|