Add a Notification Settings Button to all web notifications behind the web platform...
[chromium-blink-merge.git] / native_client_sdk / doc_generated / reference / ideas.html
blob2050481b0a3ae9797bfd681c0fe15c828d12da2c
1 {{+bindTo:partials.standard_nacl_article}}
3 <section id="contributor-ideas">
4 <span id="ideas"></span><h1 id="contributor-ideas"><span id="ideas"></span>Contributor Ideas</h1>
5 <div class="contents local" id="contents" style="display: none">
6 <ul class="small-gap">
7 <li><a class="reference internal" href="#contributing-me" id="id9">Contributing? Me‽</a></li>
8 <li><a class="reference internal" href="#google-summer-of-code" id="id10">Google Summer of Code</a></li>
9 <li><p class="first"><a class="reference internal" href="#id2" id="id11">Ideas</a></p>
10 <ul class="small-gap">
11 <li><p class="first"><a class="reference internal" href="#ports" id="id12">Ports</a></p>
12 <ul class="small-gap">
13 <li><a class="reference internal" href="#new-filesystems" id="id13">New Filesystems</a></li>
14 <li><a class="reference internal" href="#open-source-porting" id="id14">Open Source Porting</a></li>
15 </ul>
16 </li>
17 <li><p class="first"><a class="reference internal" href="#languages" id="id15">Languages</a></p>
18 <ul class="small-gap">
19 <li><a class="reference internal" href="#rust" id="id16">Rust</a></li>
20 <li><a class="reference internal" href="#haskell" id="id17">Haskell</a></li>
21 <li><a class="reference internal" href="#julia" id="id18">Julia</a></li>
22 <li><a class="reference internal" href="#scala" id="id19">Scala</a></li>
23 <li><a class="reference internal" href="#elm" id="id20">Elm</a></li>
24 <li><a class="reference internal" href="#mono" id="id21">Mono</a></li>
25 <li><a class="reference internal" href="#perl" id="id22">Perl</a></li>
26 </ul>
27 </li>
28 <li><a class="reference internal" href="#tcc" id="id23">TCC</a></li>
29 <li><p class="first"><a class="reference internal" href="#llvm-and-pnacl" id="id24">LLVM and PNaCl</a></p>
30 <ul class="small-gap">
31 <li><a class="reference internal" href="#sandboxing-optimizations" id="id25">Sandboxing Optimizations</a></li>
32 <li><a class="reference internal" href="#binary-size-reduction" id="id26">Binary Size Reduction</a></li>
33 <li><a class="reference internal" href="#vector-support" id="id27">Vector Support</a></li>
34 <li><a class="reference internal" href="#atomics" id="id28">Atomics</a></li>
35 <li><a class="reference internal" href="#security-enhanced-pnacl" id="id29">Security-enhanced PNaCl</a></li>
36 <li><a class="reference internal" href="#sanitizer-support" id="id30">Sanitizer Support</a></li>
37 </ul>
38 </li>
39 <li><p class="first"><a class="reference internal" href="#nacl" id="id31">NaCl</a></p>
40 <ul class="small-gap">
41 <li><a class="reference internal" href="#auto-sandboxing" id="id32">Auto-Sandboxing</a></li>
42 <li><a class="reference internal" href="#new-sandbox" id="id33">New Sandbox</a></li>
43 <li><a class="reference internal" href="#bit-sandbox" id="id34">64-bit Sandbox</a></li>
44 </ul>
45 </li>
46 </ul>
47 </li>
48 </ul>
50 </div><h2 id="contributing-me">Contributing? Me‽</h2>
51 <p>NaCl and PNaCl are very big projects: they expose an entire operating system to
52 developers, interact with all of the Web platform, and deal with compilers
53 extensively to allow code written in essentially any programming language to
54 execute on a variety of CPU architectures. This can be daunting when trying to
55 figure out how to contribute to the open-source project! This page tries to make
56 contributing easier by listing project ideas by broad area of interest, and
57 detailing the required experience and expectations for each idea.</p>
58 <p>This isn&#8217;t meant to constrain contributions! If you have ideas that aren&#8217;t on
59 this page please contact the <a class="reference external" href="https://groups.google.com/group/native-client-discuss">native-client-discuss</a> mailing list.</p>
60 <p>If you like an idea on this page and would like to get started, contact the
61 <a class="reference external" href="https://groups.google.com/group/native-client-discuss">native-client-discuss</a> mailing list so that we can help you find a mentor.</p>
62 <h2 id="google-summer-of-code">Google Summer of Code</h2>
63 <p>PNaCl participates in the <a class="reference external" href="https://www.google-melange.com/gsoc/homepage/google/gsoc2015">2015 Google Summer of Code</a> (see the <a class="reference external" href="https://www.google-melange.com/gsoc/org2/google/gsoc2015/pnacl">PNaCl GSoC
64 page</a>). <a class="reference external" href="https://www.google-melange.com/gsoc/document/show/gsoc_program/google/gsoc2015/help_page#4._How_does_a_student_apply">Student applications</a> are open March 1627. Discuss project ideas no
65 <a class="reference external" href="https://groups.google.com/group/native-client-discuss">native-client-discuss</a>, and submit your proposal on the GSoC page by the
66 deadline.</p>
67 <h2 id="id2">Ideas</h2>
68 <p>We&#8217;ve separated contributor ideas into broad areas of interest:</p>
69 <ul class="small-gap">
70 <li><strong>Ports</strong> encompass all the code that <em>uses</em> the PNaCl platform. Put simply,
71 the point of ports is to make existing open-source code work.</li>
72 <li><strong>Programming languages</strong> sometimes involves compiler work, and sometimes
73 requires getting an interpreter and its APIs to work well within the Web
74 platform.</li>
75 <li><strong>LLVM and PNaCl</strong> requires compiler work: PNaCl is based on the LLVM
76 toolchain, and most of the work in this area would occur in the upstream LLVM
77 repository.</li>
78 <li><strong>NaCl</strong> mostly deals with low-level systems work and security.</li>
79 </ul>
80 <h3 id="ports">Ports</h3>
81 <h4 id="new-filesystems">New Filesystems</h4>
82 <ul class="small-gap">
83 <li><strong>Project:</strong> Expose new filesystems to <a class="reference internal" href="/native-client/devguide/coding/nacl_io.html"><em>nacl_io</em></a>.</li>
84 <li><strong>Brief explanation:</strong> nacl_io exposes filesystems like html5fs and RAM disk,
85 which can be mounted and then accessed through regular POSIX APIs. New types
86 of filesystems could be exposed in a similar way, allowing developers to build
87 apps that &#8220;just work&#8221; on the Web platform while using Web APIs. A few ideas
88 include connecting to: Google Drive, Github, Dropbox.</li>
89 <li><strong>Expected results:</strong> A new filesystem is mountable using nacl_io, is well
90 tested, and used in a demo application.</li>
91 <li><strong>Knowledge Prerequisite:</strong> C++.</li>
92 <li><strong>Mentor:</strong> Sam Clegg.</li>
93 </ul>
94 <h4 id="open-source-porting">Open Source Porting</h4>
95 <ul class="small-gap">
96 <li><strong>Project:</strong> Port substantial open source projects to work in naclports.</li>
97 <li><strong>Brief explanation:</strong> naclports contains a large collection of open source
98 projects that properly compile and run on the PNaCl platform. This project
99 involves adding new useful projects to naclports, and upstreaming any patches
100 to the original project: running on PNaCl effective involves porting to a new
101 architecture and operating system. Project ideas include: Gimp, Inkscape, Gtk.</li>
102 <li><strong>Expected results:</strong> New open source projects are usable from naclports.</li>
103 <li><strong>Knowledge Prerequisite:</strong> C/C++.</li>
104 <li><strong>Mentor:</strong> Brad Nelson.</li>
105 </ul>
106 <h3 id="languages">Languages</h3>
107 <p>PNaCl already has support for C and C++, and virtual machines such as
108 JavaScript, Lua, Python and Ruby. We&#8217;d like to support more languages, either by
109 having these languages target LLVM bitcode or by making sure that the language
110 virtual machine&#8217;s APIs work well on the Web platform.</p>
111 <h4 id="rust">Rust</h4>
112 <ul class="small-gap">
113 <li><strong>Project:</strong> Support the Rust programming languages.</li>
114 <li><strong>Brief explanation:</strong> The <a class="reference external" href="http://www.rust-lang.org">Rust</a> programming language uses LLVM. The aim of
115 this project is to allow it to deliver PNaCl <code>.pexe</code> files.</li>
116 <li><strong>Expected results:</strong> The Rust test suite passes within the browser. How to
117 use Rust to target PNaCl is well documented and easy to do.</li>
118 <li><strong>Knowledge Prerequisite:</strong> Compilers, LLVM.</li>
119 <li><strong>Mentor:</strong> Ben Smith.</li>
120 </ul>
121 <h4 id="haskell">Haskell</h4>
122 <ul class="small-gap">
123 <li><strong>Project:</strong> Support the Haskell programming language.</li>
124 <li><strong>Brief explanation:</strong> <a class="reference external" href="http://www.haskell.org/ghc/docs/latest/html/users_guide/code-generators.html">GHC</a> targets LLVM. The aim of this project is to allow
125 it to deliver PNaCl <code>.pexe</code> files. One interesting difficulty will be to
126 ensure that tail call optimization occurs properly in all targets.</li>
127 <li><strong>Expected results:</strong> The Haskell test suite passes within the browser. How to
128 use Haskell to target PNaCl is well documented and easy to do.</li>
129 <li><strong>Knowledge Prerequisite:</strong> Compilers, LLVM.</li>
130 <li><strong>Mentor:</strong> Ben Smith.</li>
131 </ul>
132 <h4 id="julia">Julia</h4>
133 <ul class="small-gap">
134 <li><strong>Project:</strong> Support the Julia programming language.</li>
135 <li><strong>Brief explanation:</strong> <a class="reference external" href="http://julialang.org">Julia</a> targets LLVM, but it does so through LLVM&#8217;s
136 Just-in-Time compiler which PNaCl doens&#8217;t support. The aim of this project is
137 to allow it to deliver PNaCl <code>.pexe</code> files.</li>
138 <li><strong>Expected results:</strong> The Julia test suite passes within the browser. How to
139 use Julia to target PNaCl is well documented and easy to do.</li>
140 <li><strong>Knowledge Prerequisite:</strong> Compilers, LLVM.</li>
141 <li><strong>Mentor:</strong> Ben Smith.</li>
142 </ul>
143 <h4 id="scala">Scala</h4>
144 <ul class="small-gap">
145 <li><strong>Project:</strong> Support the Scala programming language.</li>
146 <li><strong>Brief explanation:</strong> The aim of this project is to allow <a class="reference external" href="http://www.scala-lang.org">Scala</a> to deliver
147 PNaCl <code>.pexe</code> files.</li>
148 <li><strong>Expected results:</strong> The Scala test suite passes within the browser. How to
149 use Scala to target PNaCl is well documented and easy to do.</li>
150 <li><strong>Knowledge Prerequisite:</strong> Compilers.</li>
151 <li><strong>Mentor:</strong> Ben Smith.</li>
152 </ul>
153 <h4 id="elm">Elm</h4>
154 <ul class="small-gap">
155 <li><strong>Project:</strong> Support the Elm programming language.</li>
156 <li><strong>Brief explanation:</strong> The aim of this project is to allow <a class="reference external" href="http://elm-lang.org">Elm</a> to deliver
157 PNaCl <code>.pexe</code> files.</li>
158 <li><strong>Expected results:</strong> The Elm test suite passes within the browser. How to use
159 Elm to target PNaCl is well documented and easy to do.</li>
160 <li><strong>Knowledge Prerequisite:</strong> Compilers.</li>
161 <li><strong>Mentor:</strong> Jan Voung.</li>
162 </ul>
163 <h4 id="mono">Mono</h4>
164 <ul class="small-gap">
165 <li><strong>Project:</strong> Support C# running inside Mono.</li>
166 <li><strong>Brief explanation:</strong> C# is traditionally a Just-in-Time compiled language,
167 the aim of this project is to be able to run C# code withing <a class="reference external" href="http://www.mono-project.com">Mono</a> while
168 compiling ahead-of-time.</li>
169 <li><strong>Expected results:</strong> The Mono test suite passes within the browser. How to
170 use Mono to target PNaCl is well documented and easy to do.</li>
171 <li><strong>Knowledge Prerequisite:</strong> Compilers.</li>
172 <li><strong>Mentor:</strong> Derek Schuff.</li>
173 </ul>
174 <h4 id="perl">Perl</h4>
175 <ul class="small-gap">
176 <li><strong>Project:</strong> Support Perl.</li>
177 <li><strong>Brief explanation:</strong> Port the Perl programming language and its packages to
178 the PNaCl platform.</li>
179 <li><strong>Expected results:</strong> The Perl test suite passes within the browser. How to
180 use Perl to target PNaCl is well documented and easy to do.</li>
181 <li><strong>Knowledge Prerequisite:</strong> C.</li>
182 <li><strong>Mentor:</strong> Brad Nelson.</li>
183 </ul>
184 <h3 id="tcc">TCC</h3>
185 <ul class="small-gap">
186 <li><strong>Project:</strong> Port Fabrice Ballard&#8217;s Tiny C Compiler _TCC to NaCl and PNaCl.</li>
187 <li><strong>Brief explanation:</strong> Port TCC to NaCl and enhance to follow <a class="reference external" href="https://developer.chrome.com/native-client/reference/sandbox_internals/index">NaCl sandboxing
188 rules</a>, as well as emitting <a class="reference external" href="https://developer.chrome.com/native-client/reference/pnacl-bitcode-manual">PNaCl bitcode</a>. The same could be done with
189 <a class="reference external" href="https://code.google.com/p/picoc">Pico C</a>.</li>
190 <li><strong>Expected results:</strong> Compiler ported and code generator working. Can run a
191 small benchmark of your choice.</li>
192 <li><strong>Knowledge Prerequisite:</strong> C, assembly, compilers.</li>
193 <li><strong>Mentor:</strong> JF Bastien.</li>
194 </ul>
195 <h3 id="llvm-and-pnacl">LLVM and PNaCl</h3>
196 <p>PNaCl relies heavily on LLVM in two key areas:</p>
197 <ul class="small-gap">
198 <li>On the developer&#8217;s machine, LLVM is used as a regular toolchain to parse code,
199 optimize it, and create a portable executable.</li>
200 <li>On user devices, LLVM is installed as part of Chrome to translate a portable
201 executable into a machine-specific sandboxed executable.</li>
202 </ul>
203 <p>Most of the contribution ideas around LLVM would occur in the upstream LLVM
204 repository, and would improve LLVM for more than just PNaCl&#8217;s sake (though PNaCl
205 is of course benefiting from these improvements!). Some of these ideas would
206 also apply to <a class="reference external" href="https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/README.rst">Subzero</a>, a small and fast translator from portable executable to
207 machine-specific code.</p>
208 <h4 id="sandboxing-optimizations">Sandboxing Optimizations</h4>
209 <ul class="small-gap">
210 <li><strong>Project:</strong> Improved sandboxed code generation.</li>
211 <li><strong>Brief explanation:</strong> PNaCl generates code that targets the NaCl sandbox, but
212 this code generation isn&#8217;t always optimal and sometimes results in a
213 performance lost of 10% to 25% compared to unsandboxed code. This project
214 would require looking at the x86-32, x86-64, ARM and MIPS code being generated
215 by LLVM or Subzero and figuring out how it can be improved to execute
216 faster. As an example, one could write a compiler pass to figure out when
217 doing a zero-extending <code>lea</code> on NaCl x86-64 would be useful (increment and
218 sandbox), or see if <code>%rbp</code> can be used more for loads/stores unrelated to
219 the call frame.</li>
220 <li><strong>Expected results:</strong> Sandboxed code runs measurably faster, and gets much
221 closer to unsandboxed code performance. PNaCl has a fairly extensive
222 performance test suite to measure these improvements.</li>
223 <li><strong>Knowledge Prerequisite:</strong> Compilers, assembly.</li>
224 <li><strong>Mentor:</strong> Jan Voung.</li>
225 </ul>
226 <h4 id="binary-size-reduction">Binary Size Reduction</h4>
227 <ul class="small-gap">
228 <li><strong>Project:</strong> Reduce the size of binaries generated by LLVM.</li>
229 <li><strong>Brief explanation:</strong> This is generally useful for the LLVM project, but is
230 especially important for PNaCl and Emscripten because we deliver code on the
231 Web (transfer size and compile time matter!). This stands to drastically
232 improve transfer time, and load time. Reduces the size of the PNaCl translator
233 as well as user code, makes the generated portable executables smaller and
234 translation size faster. Improve LLVM’s <code>mergefuncs</code> pass to reduce
235 redundancy of code. Detect functions and data that aren’t used. Improve
236 partial evaluation: can e.g. LLVM’s command-line parsing be mostly removed
237 from the PNaCl translator? Potentially add a pass where a developer manually
238 marks functions as unused, and have LLVM replace them with <code>abort</code> (this
239 should propagate and mark other code as dead). This list could be created by
240 using code coverage information.</li>
241 <li><strong>Expected results:</strong> Portable executables in the PNaCl repository are
242 measurably smaller and translate faster.</li>
243 <li><strong>Knowledge Prerequisite:</strong> LLVM bitcode.</li>
244 <li><strong>Mentor:</strong> JF Bastien.</li>
245 </ul>
246 <h4 id="vector-support">Vector Support</h4>
247 <ul class="small-gap">
248 <li><strong>Project:</strong> Improve PNaCl SIMD support.</li>
249 <li><strong>Brief explanation:</strong> PNaCl offers speed on the Web, and generating good SIMD
250 code allows developers to use the full capabilities of the device (better user
251 experience, longer battery life). The goal of this project is to allow
252 developers to use more hardware features in a portable manner by exposing
253 portable SIMD primitives and using auto-vectorization. This could also mean
254 making the architecture-specific intrinsics “just work” within PNaCl (lower
255 them to equivalent architecture-independent intrinsics).</li>
256 <li><strong>Expected results:</strong> Sample code and existing applications run measurably
257 faster by using portable SIMD and/or by auto-vectorizing.</li>
258 <li><strong>Knowledge Prerequisite:</strong> Compilers, high-performance code tuning.</li>
259 <li><strong>Mentor:</strong> JF Bastien.</li>
260 </ul>
261 <h4 id="atomics">Atomics</h4>
262 <ul class="small-gap">
263 <li><strong>Project:</strong> Improve the performance of C++11 atomics.</li>
264 <li><strong>Brief explanation:</strong> C++11 atomics allow programmers to shed inline assembly
265 and use language-level features to express high-performance code. This is
266 great for portability, but atomics currently aren&#8217;t as fast as they could be
267 on all platforms. We had an intern work on this in the summer of 2014, see his
268 LLVM developer conference presentation <a class="reference external" href="http://llvm.org/devmtg/2014-10/#talk10">Blowing up the atomic barrier</a>. This
269 project would be a continuation of this work: improve LLVM&#8217;s code generation
270 for atomics.</li>
271 <li><strong>Expected results:</strong> Code using C++11 atomics runs measurably faster on
272 different architectures.</li>
273 <li><strong>Knowledge Prerequisite:</strong> Compilers, memory models.</li>
274 <li><strong>Mentor:</strong> JF Bastien.</li>
275 </ul>
276 <h4 id="security-enhanced-pnacl">Security-enhanced PNaCl</h4>
277 <ul class="small-gap">
278 <li><strong>Project:</strong> Security in-depth for PNaCl.</li>
279 <li><strong>Brief explanation:</strong> PNaCl brings native code to the Web, and we want to
280 improve the security of the platform as well as explore novel mitigations.
281 This allows PNaCl to take better advantage of the hardware and operating
282 system it&#8217;s running on and makes the platform even faster while keeping users
283 safe. It’s also useful for non-browser uses of PNaCl such as running untrusted
284 code in the Cloud. A few areas to explore are: code randomization for LLVM and
285 Subzero, fuzzing of the translator, code hiding at compilation time, and code
286 tuning to the hardware and operating system the untrusted code is running on.</li>
287 <li><strong>Expected results:</strong> The security design and implementation successfully pass
288 a review with the Chrome security team.</li>
289 <li><strong>Knowledge Prerequisite:</strong> Security.</li>
290 <li><strong>Mentor:</strong> JF Bastien.</li>
291 </ul>
292 <h4 id="sanitizer-support">Sanitizer Support</h4>
293 <ul class="small-gap">
294 <li><strong>Project:</strong> Sanitizer support for untrusted code.</li>
295 <li><strong>Brief explanation:</strong> LLVM supports many <a class="reference external" href="http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation">sanitizers</a> for C/C++ using the
296 <code>-fsanitize=&lt;name&gt;</code>. Some of these sanitizers currently work, and some don&#8217;t
297 because they use clever tricks to perform their work, such as using <code>mmap</code>
298 to allocate a special shadow memory region with a specific address. This
299 project requires adding full support to all of LLVM&#8217;s sanitizers for untrusted
300 user code within PNaCl.</li>
301 <li><strong>Expected results:</strong> The sanitizer tests successfully run as untrusted code
302 within PNaCl.</li>
303 <li><strong>Knowledge Prerequisite:</strong> Compilers.</li>
304 <li><strong>Mentor:</strong> JF Bastien.</li>
305 </ul>
306 <h3 id="nacl">NaCl</h3>
307 <h4 id="auto-sandboxing">Auto-Sandboxing</h4>
308 <ul class="small-gap">
309 <li><strong>Project:</strong> Auto-sandboxing assembler.</li>
310 <li><strong>Brief explanation:</strong> NaCl has a toolchain which can sandbox native
311 code. This toolchain can consume C/C++ as well as pre-sandboxed assembly, or
312 assembly which uses special sandboxing macros. The goal of this project is to
313 follow NaCl&#8217;s sandboxing requirements automatically which compiling assembly
314 files.</li>
315 <li><strong>Expected results:</strong> Existing assembly code can be compiled to a native
316 executable that follows NaCl&#8217;s sandboxing rules.</li>
317 <li><strong>Knowledge Prerequisite:</strong> Assemblers.</li>
318 <li><strong>Mentor:</strong> Derek Schuff, Roland McGrath.</li>
319 </ul>
320 <h4 id="new-sandbox">New Sandbox</h4>
321 <ul class="small-gap">
322 <li><strong>Project:</strong> Create a new software-fault isolation sandbox.</li>
323 <li><strong>Brief explanation:</strong> NaCl pioneered production-quality sandboxes based on
324 software-fault isolation, and currently supports x86-32, x86-64, ARMv7&#8217;s ARM,
325 and MIPS. This project involves designing and implementing new sandboxes. Of
326 particular interest are ARMv8&#8217;s aarch64 and Power8. This also requires
327 implementing sandboxing in the compiler.</li>
328 <li><strong>Expected results:</strong> The new sandbox&#8217;s design and implementation successfully
329 pass a review with the Chrome security team. Existing NaCl code successfully
330 runs in the new sandbox.</li>
331 <li><strong>Knowledge Prerequisite:</strong> Security, low-level assembly, compilers, LLVM.</li>
332 <li><strong>Mentor:</strong> David Sehr.</li>
333 </ul>
334 <h4 id="bit-sandbox">64-bit Sandbox</h4>
335 <ul class="small-gap">
336 <li><strong>Project:</strong> Create a 64-bit sandbox.</li>
337 <li><strong>Brief explanation:</strong> NaCl currently supports sandboxes where pointers are
338 32-bits. Some applications, both in-browser and not in-browser, would benefit
339 from a larger address space. This project involves designing and implementing
340 a model for 64-bit sandboxes on all architecture NaCl currently supports. This
341 also requires supporting 64-bit pointers in PNaCl using the <code>le64</code> platform,
342 and updating the code generation for each platform.</li>
343 <li><strong>Expected results:</strong> The new sandbox&#8217;s design and implementation successfully
344 pass a review with the Chrome security team. Existing NaCl code successfully
345 runs in the new sandbox.</li>
346 <li><strong>Knowledge Prerequisite:</strong> Security, low-level assembly, compilers, LLVM.</li>
347 <li><strong>Mentor:</strong> David Sehr.</li>
348 </ul>
349 </section>
351 {{/partials.standard_nacl_article}}