15 NaCl and PNaCl are very big projects: they expose an entire operating system to
16 developers, interact with all of the Web platform, and deal with compilers
17 extensively to allow code written in essentially any programming language to
18 execute on a variety of CPU architectures. This can be daunting when trying to
19 figure out how to contribute to the open-source project! This page tries to make
20 contributing easier by listing project ideas by broad area of interest, and
21 detailing the required experience and expectations for each idea.
23 This isn't meant to constrain contributions! If you have ideas that aren't on
24 this page please contact the native-client-discuss_ mailing list.
26 If you like an idea on this page and would like to get started, contact the
27 native-client-discuss_ mailing list so that we can help you find a mentor.
29 .. _native-client-discuss: https://groups.google.com/group/native-client-discuss
34 PNaCl participates in the `2015 Google Summer of Code`_ (see the `PNaCl GSoC
35 page`_). `Student applications`_ are open March 16–27. Discuss project ideas no
36 native-client-discuss_, and submit your proposal on the GSoC page by the
39 .. _PNaCl GSoC page: https://www.google-melange.com/gsoc/org2/google/gsoc2015/pnacl
40 .. _2015 Google Summer of Code: https://www.google-melange.com/gsoc/homepage/google/gsoc2015
41 .. _Student applications: https://www.google-melange.com/gsoc/document/show/gsoc_program/google/gsoc2015/help_page#4._How_does_a_student_apply
46 We've separated contributor ideas into broad areas of interest:
48 * **Ports** encompass all the code that *uses* the PNaCl platform. Put simply,
49 the point of ports is to make existing open-source code work.
50 * **Programming languages** sometimes involves compiler work, and sometimes
51 requires getting an interpreter and its APIs to work well within the Web
53 * **LLVM and PNaCl** requires compiler work: PNaCl is based on the LLVM
54 toolchain, and most of the work in this area would occur in the upstream LLVM
56 * **NaCl** mostly deals with low-level systems work and security.
60 Adding a proposal to this document should follow this format:
61 Project: *project title*
62 Brief explanation: *brief description*
63 Expected results: *how do we evaluate the project's success?*
64 Knowledge Prerequisite: *programming languages, CS topics, ...*
65 Mentor: *one or multiple, their roles in this project*
66 The above list is inspired by the Google Summer of Code guidelines, and the
75 * **Project:** Expose new filesystems to :doc:`nacl_io
76 </devguide/coding/nacl_io>`.
77 * **Brief explanation:** nacl_io exposes filesystems like html5fs and RAM disk,
78 which can be mounted and then accessed through regular POSIX APIs. New types
79 of filesystems could be exposed in a similar way, allowing developers to build
80 apps that "just work" on the Web platform while using Web APIs. A few ideas
81 include connecting to: Google Drive, Github, Dropbox.
82 * **Expected results:** A new filesystem is mountable using nacl_io, is well
83 tested, and used in a demo application.
84 * **Knowledge Prerequisite:** C++.
85 * **Mentor:** Sam Clegg.
90 * **Project:** Port substantial open source projects to work in naclports.
91 * **Brief explanation:** naclports contains a large collection of open source
92 projects that properly compile and run on the PNaCl platform. This project
93 involves adding new useful projects to naclports, and upstreaming any patches
94 to the original project: running on PNaCl effective involves porting to a new
95 architecture and operating system. Project ideas include: Gimp, Inkscape, Gtk.
96 * **Expected results:** New open source projects are usable from naclports.
97 * **Knowledge Prerequisite:** C/C++.
98 * **Mentor:** Brad Nelson.
104 PNaCl already has support for C and C++, and virtual machines such as
105 JavaScript, Lua, Python and Ruby. We'd like to support more languages, either by
106 having these languages target LLVM bitcode or by making sure that the language
107 virtual machine's APIs work well on the Web platform.
112 * **Project:** Support the Rust programming languages.
113 * **Brief explanation:** The Rust_ programming language uses LLVM. The aim of
114 this project is to allow it to deliver PNaCl ``.pexe`` files.
115 * **Expected results:** The Rust test suite passes within the browser. How to
116 use Rust to target PNaCl is well documented and easy to do.
117 * **Knowledge Prerequisite:** Compilers, LLVM.
118 * **Mentor:** Ben Smith.
120 .. _Rust: http://www.rust-lang.org
125 * **Project:** Support the Haskell programming language.
126 * **Brief explanation:** GHC_ targets LLVM. The aim of this project is to allow
127 it to deliver PNaCl ``.pexe`` files. One interesting difficulty will be to
128 ensure that tail call optimization occurs properly in all targets.
129 * **Expected results:** The Haskell test suite passes within the browser. How to
130 use Haskell to target PNaCl is well documented and easy to do.
131 * **Knowledge Prerequisite:** Compilers, LLVM.
132 * **Mentor:** Ben Smith.
135 http://www.haskell.org/ghc/docs/latest/html/users_guide/code-generators.html
140 * **Project:** Support the Julia programming language.
141 * **Brief explanation:** Julia_ targets LLVM, but it does so through LLVM's
142 Just-in-Time compiler which PNaCl doens't support. The aim of this project is
143 to allow it to deliver PNaCl ``.pexe`` files.
144 * **Expected results:** The Julia test suite passes within the browser. How to
145 use Julia to target PNaCl is well documented and easy to do.
146 * **Knowledge Prerequisite:** Compilers, LLVM.
147 * **Mentor:** Ben Smith.
149 .. _Julia: http://julialang.org
154 * **Project:** Support the Scala programming language.
155 * **Brief explanation:** The aim of this project is to allow Scala_ to deliver
156 PNaCl ``.pexe`` files.
157 * **Expected results:** The Scala test suite passes within the browser. How to
158 use Scala to target PNaCl is well documented and easy to do.
159 * **Knowledge Prerequisite:** Compilers.
160 * **Mentor:** Ben Smith.
162 .. _Scala: http://www.scala-lang.org
167 * **Project:** Support the Elm programming language.
168 * **Brief explanation:** The aim of this project is to allow Elm_ to deliver
169 PNaCl ``.pexe`` files.
170 * **Expected results:** The Elm test suite passes within the browser. How to use
171 Elm to target PNaCl is well documented and easy to do.
172 * **Knowledge Prerequisite:** Compilers.
173 * **Mentor:** Jan Voung.
175 .. _Elm: http://elm-lang.org
180 * **Project:** Support C# running inside Mono.
181 * **Brief explanation:** C# is traditionally a Just-in-Time compiled language,
182 the aim of this project is to be able to run C# code withing Mono_ while
183 compiling ahead-of-time.
184 * **Expected results:** The Mono test suite passes within the browser. How to
185 use Mono to target PNaCl is well documented and easy to do.
186 * **Knowledge Prerequisite:** Compilers.
187 * **Mentor:** Derek Schuff.
189 .. _Mono: http://www.mono-project.com
194 * **Project:** Support Perl.
195 * **Brief explanation:** Port the Perl programming language and its packages to
197 * **Expected results:** The Perl test suite passes within the browser. How to
198 use Perl to target PNaCl is well documented and easy to do.
199 * **Knowledge Prerequisite:** C.
200 * **Mentor:** Brad Nelson.
205 * **Project:** Port Fabrice Ballard's Tiny C Compiler _TCC to NaCl and PNaCl.
206 * **Brief explanation:** Port TCC to NaCl and enhance to follow `NaCl sandboxing
207 rules`_, as well as emitting `PNaCl bitcode`_. The same could be done with
209 * **Expected results:** Compiler ported and code generator working. Can run a
210 small benchmark of your choice.
211 * **Knowledge Prerequisite:** C, assembly, compilers.
212 * **Mentor:** JF Bastien.
214 .. _`NaCl sandboxing rules`: https://developer.chrome.com/native-client/reference/sandbox_internals/index
215 .. _`PNaCl bitcode`: https://developer.chrome.com/native-client/reference/pnacl-bitcode-manual
216 .. _TCC: http://bellard.org/tcc/
217 .. _`Pico C`: https://code.google.com/p/picoc
223 PNaCl relies heavily on LLVM in two key areas:
225 * On the developer's machine, LLVM is used as a regular toolchain to parse code,
226 optimize it, and create a portable executable.
227 * On user devices, LLVM is installed as part of Chrome to translate a portable
228 executable into a machine-specific sandboxed executable.
230 Most of the contribution ideas around LLVM would occur in the upstream LLVM
231 repository, and would improve LLVM for more than just PNaCl's sake (though PNaCl
232 is of course benefiting from these improvements!). Some of these ideas would
233 also apply to Subzero_, a small and fast translator from portable executable to
234 machine-specific code.
236 .. _Subzero: https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/README.rst
238 Sandboxing Optimizations
239 ^^^^^^^^^^^^^^^^^^^^^^^^
241 * **Project:** Improved sandboxed code generation.
242 * **Brief explanation:** PNaCl generates code that targets the NaCl sandbox, but
243 this code generation isn't always optimal and sometimes results in a
244 performance lost of 10% to 25% compared to unsandboxed code. This project
245 would require looking at the x86-32, x86-64, ARM and MIPS code being generated
246 by LLVM or Subzero and figuring out how it can be improved to execute
247 faster. As an example, one could write a compiler pass to figure out when
248 doing a zero-extending ``lea`` on NaCl x86-64 would be useful (increment and
249 sandbox), or see if ``%rbp`` can be used more for loads/stores unrelated to
251 * **Expected results:** Sandboxed code runs measurably faster, and gets much
252 closer to unsandboxed code performance. PNaCl has a fairly extensive
253 performance test suite to measure these improvements.
254 * **Knowledge Prerequisite:** Compilers, assembly.
255 * **Mentor:** Jan Voung.
257 Binary Size Reduction
258 ^^^^^^^^^^^^^^^^^^^^^
260 * **Project:** Reduce the size of binaries generated by LLVM.
261 * **Brief explanation:** This is generally useful for the LLVM project, but is
262 especially important for PNaCl and Emscripten because we deliver code on the
263 Web (transfer size and compile time matter!). This stands to drastically
264 improve transfer time, and load time. Reduces the size of the PNaCl translator
265 as well as user code, makes the generated portable executables smaller and
266 translation size faster. Improve LLVM’s ``mergefuncs`` pass to reduce
267 redundancy of code. Detect functions and data that aren’t used. Improve
268 partial evaluation: can e.g. LLVM’s command-line parsing be mostly removed
269 from the PNaCl translator? Potentially add a pass where a developer manually
270 marks functions as unused, and have LLVM replace them with ``abort`` (this
271 should propagate and mark other code as dead). This list could be created by
272 using code coverage information.
273 * **Expected results:** Portable executables in the PNaCl repository are
274 measurably smaller and translate faster.
275 * **Knowledge Prerequisite:** LLVM bitcode.
276 * **Mentor:** JF Bastien.
281 * **Project:** Improve PNaCl SIMD support.
282 * **Brief explanation:** PNaCl offers speed on the Web, and generating good SIMD
283 code allows developers to use the full capabilities of the device (better user
284 experience, longer battery life). The goal of this project is to allow
285 developers to use more hardware features in a portable manner by exposing
286 portable SIMD primitives and using auto-vectorization. This could also mean
287 making the architecture-specific intrinsics “just work” within PNaCl (lower
288 them to equivalent architecture-independent intrinsics).
289 * **Expected results:** Sample code and existing applications run measurably
290 faster by using portable SIMD and/or by auto-vectorizing.
291 * **Knowledge Prerequisite:** Compilers, high-performance code tuning.
292 * **Mentor:** JF Bastien.
297 * **Project:** Improve the performance of C++11 atomics.
298 * **Brief explanation:** C++11 atomics allow programmers to shed inline assembly
299 and use language-level features to express high-performance code. This is
300 great for portability, but atomics currently aren't as fast as they could be
301 on all platforms. We had an intern work on this in the summer of 2014, see his
302 LLVM developer conference presentation `Blowing up the atomic barrier`_. This
303 project would be a continuation of this work: improve LLVM's code generation
305 * **Expected results:** Code using C++11 atomics runs measurably faster on
306 different architectures.
307 * **Knowledge Prerequisite:** Compilers, memory models.
308 * **Mentor:** JF Bastien.
310 .. _`Blowing up the atomic barrier`: http://llvm.org/devmtg/2014-10/#talk10
312 Security-enhanced PNaCl
313 ^^^^^^^^^^^^^^^^^^^^^^^
315 * **Project:** Security in-depth for PNaCl.
316 * **Brief explanation:** PNaCl brings native code to the Web, and we want to
317 improve the security of the platform as well as explore novel mitigations.
318 This allows PNaCl to take better advantage of the hardware and operating
319 system it's running on and makes the platform even faster while keeping users
320 safe. It’s also useful for non-browser uses of PNaCl such as running untrusted
321 code in the Cloud. A few areas to explore are: code randomization for LLVM and
322 Subzero, fuzzing of the translator, code hiding at compilation time, and code
323 tuning to the hardware and operating system the untrusted code is running on.
324 * **Expected results:** The security design and implementation successfully pass
325 a review with the Chrome security team.
326 * **Knowledge Prerequisite:** Security.
327 * **Mentor:** JF Bastien.
332 * **Project:** Sanitizer support for untrusted code.
333 * **Brief explanation:** LLVM supports many sanitizers_ for C/C++ using the
334 ``-fsanitize=<name>``. Some of these sanitizers currently work, and some don't
335 because they use clever tricks to perform their work, such as using ``mmap``
336 to allocate a special shadow memory region with a specific address. This
337 project requires adding full support to all of LLVM's sanitizers for untrusted
338 user code within PNaCl.
339 * **Expected results:** The sanitizer tests successfully run as untrusted code
341 * **Knowledge Prerequisite:** Compilers.
342 * **Mentor:** JF Bastien.
344 .. _sanitizers: http://clang.llvm.org/docs/UsersManual.html#controlling-code-generation
352 * **Project:** Auto-sandboxing assembler.
353 * **Brief explanation:** NaCl has a toolchain which can sandbox native
354 code. This toolchain can consume C/C++ as well as pre-sandboxed assembly, or
355 assembly which uses special sandboxing macros. The goal of this project is to
356 follow NaCl's sandboxing requirements automatically which compiling assembly
358 * **Expected results:** Existing assembly code can be compiled to a native
359 executable that follows NaCl's sandboxing rules.
360 * **Knowledge Prerequisite:** Assemblers.
361 * **Mentor:** Derek Schuff, Roland McGrath.
366 * **Project:** Create a new software-fault isolation sandbox.
367 * **Brief explanation:** NaCl pioneered production-quality sandboxes based on
368 software-fault isolation, and currently supports x86-32, x86-64, ARMv7's ARM,
369 and MIPS. This project involves designing and implementing new sandboxes. Of
370 particular interest are ARMv8's aarch64 and Power8. This also requires
371 implementing sandboxing in the compiler.
372 * **Expected results:** The new sandbox's design and implementation successfully
373 pass a review with the Chrome security team. Existing NaCl code successfully
374 runs in the new sandbox.
375 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
376 * **Mentor:** David Sehr.
381 * **Project:** Create a 64-bit sandbox.
382 * **Brief explanation:** NaCl currently supports sandboxes where pointers are
383 32-bits. Some applications, both in-browser and not in-browser, would benefit
384 from a larger address space. This project involves designing and implementing
385 a model for 64-bit sandboxes on all architecture NaCl currently supports. This
386 also requires supporting 64-bit pointers in PNaCl using the ``le64`` platform,
387 and updating the code generation for each platform.
388 * **Expected results:** The new sandbox's design and implementation successfully
389 pass a review with the Chrome security team. Existing NaCl code successfully
390 runs in the new sandbox.
391 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
392 * **Mentor:** David Sehr.