Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(285)

Side by Side Diff: native_client_sdk/doc_generated/nacl-and-pnacl.html

Issue 581643004: Copy edit Learn Basics section. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes from Patch Set 1 feedback. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 {{+bindTo:partials.standard_nacl_article}} 1 {{+bindTo:partials.standard_nacl_article}}
2 2
3 <section id="nacl-and-pnacl"> 3 <section id="nacl-and-pnacl">
4 <span id="id1"></span><h1 id="nacl-and-pnacl"><span id="id1"></span>NaCl and PNa Cl</h1> 4 <span id="id1"></span><h1 id="nacl-and-pnacl"><span id="id1"></span>NaCl and PNa Cl</h1>
5 <p>This document describes the differences between <strong>Native Client</strong > and 5 <p>This document describes the differences between <strong>Native Client</strong > and
6 <strong>Portable Native Client</strong>, and provides recommendations for when t o use each.</p> 6 <strong>Portable Native Client</strong>, and provides recommendations for when t o use each.</p>
7 <div class="contents local" id="contents" style="display: none"> 7 <div class="contents local" id="contents" style="display: none">
8 <ul class="small-gap"> 8 <ul class="small-gap">
9 <li><a class="reference internal" href="#native-client-nacl" id="id3">Native Cli ent (NaCl)</a></li> 9 <li><a class="reference internal" href="#native-client-nacl" id="id6">Native Cli ent (NaCl)</a></li>
10 <li><a class="reference internal" href="#portable-native-client-pnacl" id="id4"> Portable Native Client (PNaCl)</a></li> 10 <li><a class="reference internal" href="#portable-native-client-pnacl" id="id7"> Portable Native Client (PNaCl)</a></li>
11 <li><a class="reference internal" href="#when-to-use-pnacl" id="id5">When to use PNaCl</a></li> 11 <li><a class="reference internal" href="#when-to-use-pnacl" id="id8">When to use PNaCl</a></li>
12 <li><a class="reference internal" href="#when-to-use-nacl" id="id6">When to use NaCl</a></li> 12 <li><a class="reference internal" href="#when-to-use-nacl" id="id9">When to use NaCl</a></li>
13 </ul> 13 </ul>
14 14
15 </div><h2 id="native-client-nacl">Native Client (NaCl)</h2> 15 </div><h2 id="native-client-nacl"><span id="id2"></span>Native Client (NaCl)</h2 >
16 <p>Native Client enables the execution of native code securely inside web 16 <p>Native Client enables the execution of native code securely inside web
17 applications through the use of advanced <a class="reference external" href="htt p://research.google.com/pubs/pub35649.html">Software Fault Isolation (SFI) 17 applications through the use of advanced <a class="reference external" href="htt p://research.google.com/pubs/pub35649.html">Software Fault Isolation (SFI)
18 techniques</a>. Since its launch in 18 techniques</a>. Native Client
19 2011, Native Client has provided developers with the ability to harness a 19 allows you to harness a client machine&#8217;s computational power to a fuller e xtent
20 client machine&#8217;s computational power to a much fuller extent than traditio nal 20 than traditional web technologies by running compiled C and C++ code at
21 web technologies, by running compiled C and C++ code at near-native speeds and 21 near-native speeds and taking advantage of multiple cores with shared memory.</p >
22 taking advantage of multiple cores with shared memory.</p> 22 <p>While Native Client provides operating system independence, it requires you t o
23 <p>While Native Client provides operating system independence, it requires 23 generate architecture-specific executables (<strong>nexe</strong>) for each hard ware
24 developers to generate architecture-specific executable 24 platform. This is neither portable nor conveient, making it ill-suited for the
25 (<strong>nexe</strong>) modules for each hardware platform. This is not only inc onvenient 25 open web.</p>
26 for developers, but architecture-specific machine code is not portable and thus 26 <p>The traditional method of application distribution on the web is through self -
27 not well-suited for the open web. The traditional method of application 27 contained bundles of HTML, CSS, JavaScript, and other resources (images, etc.)
28 distribution on the web is through a self-contained bundle of HTML, CSS, 28 that can be hosted on a server and run inside a web browser. With this type of
29 JavaScript, and other resources (images, etc.) that can be hosted on a server 29 distribution, a website created today should still work years later, on all
30 and run inside a web browser. With this type of distribution, a website 30 platforms. Architecture-specific executables are clearly not a good fit for
31 created today should still work years later, on all platforms. 31 distribution on the web. Consequently, Native Client has been until recently
32 Architecture-specific executables are clearly not a good fit for distribution 32 restricted to applications and browser extensions that are installed through the
33 on the web. As a consequence, Native Client has been restricted to
34 applications and browser extensions that are installed through the
35 Chrome Web Store.</p> 33 Chrome Web Store.</p>
36 <h2 id="portable-native-client-pnacl">Portable Native Client (PNaCl)</h2> 34 <h2 id="portable-native-client-pnacl"><span id="id3"></span>Portable Native Clie nt (PNaCl)</h2>
37 <p>PNaCl solves the portability problem by splitting the compilation process 35 <p>PNaCl solves the portability problem by splitting the compilation process
38 into two parts:</p> 36 into two parts:</p>
39 <ol class="arabic simple"> 37 <ol class="arabic simple">
40 <li>compiling the source code to a portable bitcode format, and</li> 38 <li>compiling the source code to a bitcode executable (pexe), and</li>
41 <li>translating the bitcode to a host-specific executable just before execution. </li> 39 <li>translating the bitcode to a host-specific executable as soon as the module
40 loads in the browser but before any code execution.</li>
42 </ol> 41 </ol>
43 <p>PNaCl enables developers to distribute <strong>portable executables</strong> (<strong>pexe</strong>) 42 <p>This portability aligns Native Client with existing open web technologies suc h
44 modules that the hosting environment (in other words, the Chrome browser) can 43 as JavaScript. You can distribute a pexe as part of an application (along with
45 translate to native code before executing. This portability aligns Native Client 44 HTML, CSS, and JavaScript), and the user&#8217;s machine is simply able to run i t.</p>
46 with existing open web technologies such as JavaScript. A developer can 45 <p>With PNaCl, you&#8217;ll generate a single pexe, rather than multiple platfor m-
47 distribute a <strong>pexe</strong> as part of an application (along with HTML, C SS, and 46 specific nexes. Since the pexe uses an abstract, architecture- and os-
48 JavaScript), and the user&#8217;s machine is simply able to run it.</p> 47 independent format, it does not suffer from the portability problem described
49 <p>With PNaCl, a developer generates a single <strong>pexe</strong> from source code, 48 above. Future versions of hosting environments should have no problem executing
50 rather than multiple platform-specific nexes. The <strong>pexe</strong> provides both 49 the pexe, even on new architectures. Moreover, if an existing architecture is
51 architecture- and OS-independence. Since the <strong>pexe</strong> uses an abstr act, 50 enhanced, the pexe doesn&#8217;t need to be recompiled. In some cases the client -side
52 architecture-independent format, it does not suffer from the portability 51 translation will automatically take advantage of new capabilities. A pexe can be
53 problem described above. Future versions of hosting environments should 52 part of any web application. It does not have to be distributed through the
54 have no problem executing the <strong>pexe</strong>, even on new architectures. 53 Chrome Web Store. In short, PNaCl combines the portability of existing web
55 Moreover, if an existing architecture is subsequently enhanced, the 54 technologies with the performance and security benefits of Native Client.</p>
56 <strong>pexe</strong> doesn&#8217;t even have to be recompiled. In some cases th e
57 client-side translation will automatically be able to take advantage of
58 the new capabilities. A <strong>pexe</strong> module can be part of any web
59 application. It does not have to be distributed through the Chrome Web
60 Store. In short, PNaCl combines the portability of existing web technologies
61 with the performance and security benefits of Native Client.</p>
62 <p>PNaCl is a new technology, and as such it still has a few limitations 55 <p>PNaCl is a new technology, and as such it still has a few limitations
63 as compared to NaCl. These limitations are described below.</p> 56 as compared to NaCl. These limitations are described below.</p>
64 <h2 id="when-to-use-pnacl">When to use PNaCl</h2> 57 <h2 id="when-to-use-pnacl"><span id="id4"></span>When to use PNaCl</h2>
65 <p>PNaCl is the preferred toolchain for Native Client, and the only way to deplo y 58 <p>PNaCl is the preferred toolchain for Native Client, and the only way to deplo y
66 Native Client modules on the open web. Unless your project is subject to one 59 Native Client modules without the Google Web Store. Unless your project is
67 of the narrow limitations described below 60 subject to one of the narrow limitations described under &#8220;<a class="refere nce internal" href="#when-to-use-nacl"><em>When to use
68 (see <a class="reference internal" href="#when-to-use-nacl"><em>When to use NaCl </em></a>), you should use PNaCl.</p> 61 NaCl</em></a>&#8221;, you should use PNaCl.</p>
69 <p>Beginning with version 31, the Chrome browser supports translation of 62 <p>Since version 31, Chrome supports translation of pexe
70 <strong>pexe</strong> modules and their use in web applications, without requiri ng 63 modules and their use in web applications without requiring installation either
71 any installation (either of a browser plugin or of the applications 64 of a browser plug-in or of the applications themselves. Native Client and PNaCl
72 themselves). Native Client and PNaCl are open-source technologies, and 65 are open-source technologies, and our hope is that they will be added to other
73 our hope is that they will be added to other hosting platforms in the 66 hosting platforms in the future.</p>
74 future.</p> 67 <p>If controlled distribution through the Chrome Web Store is an important part of
75 <p>If controlled distribution through the Chrome Web Store is an important part 68 your product plan, the benefits of PNaCl are less critical for you. But you can
76 of your product plan, the benefits of PNaCl are less critical for you. But 69 still use the PNaCl toolchain and distribute your application through the Chrome
77 you can still use the PNaCl toolchain and distribute your application 70 Web Store, and thereby take advantage of the conveniences of PNaCl, such as not
78 through the Chrome Web Store, and thereby take advantage of the 71 having to explicitly compile your application for all supported architectures.</ p>
79 conveniences of PNaCl, such as not having to explicitly compile your application 72 <h2 id="when-to-use-nacl"><span id="id5"></span>When to use NaCl</h2>
80 for all supported architectures.</p> 73 <p>Use NaCl if any of the following apply to your application:</p>
81 <h2 id="when-to-use-nacl"><span id="id2"></span>When to use NaCl</h2>
82 <p>The limitations below apply to the current release of PNaCl. If any of
83 these limitations are critical for your application, you should use
84 non-portable NaCl:</p>
85 <ul class="small-gap"> 74 <ul class="small-gap">
86 <li>PNaCl does not support architecture-specific 75 <li>Your application requires architecture-specific instructions such as, for
87 instructions in an application (i.e., inline assembly), but tries to 76 example, inline assembly. PNaCl tries to offer high-performance portable
88 offer high-performance portable equivalents. One such example is 77 equivalents. One such example is PNaCl&#8217;s <a class="reference internal" hre f="/native-client/reference/pnacl-c-cpp-language-support.html#portable-simd-vect ors"><em>Portable SIMD Vectors</em></a>.</li>
89 PNaCl&#8217;s <a class="reference internal" href="/native-client/reference/pnacl -c-cpp-language-support.html#portable-simd-vectors"><em>Portable SIMD Vectors</e m></a>.</li> 78 <li>Your application uses dynamic linking. PNaCl only supports static linking
90 <li>PNaCl only supports static linking with the <code>newlib</code> 79 with a PNaCl port of the <code>newlib</code> C standard library . Dynamic linkin g and
91 C standard library (the Native Client SDK provides a PNaCl port of 80 <code>glibc</code> are not yet supported in PNaCl. Work is under way to enable d ynamic
92 <code>newlib</code>). Dynamic linking and <code>glibc</code> are not yet support ed. 81 linking in future versions of PNaCl.</li>
93 Work is under way to enable dynamic linking in future versions of PNaCl.</li> 82 <li>Your application uses certain GNU extensions not supported by PNaCl, like
94 <li>PNaCl does not support some GNU extensions 83 taking the address of a label for computed <code>goto</code>, or nested function s.</li>
95 like taking the address of a label for computed <code>goto</code>, or nested
96 functions.</li>
97 </ul> 84 </ul>
98 </section> 85 </section>
99 86
100 {{/partials.standard_nacl_article}} 87 {{/partials.standard_nacl_article}}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698