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