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 rule, as well as emitting PNaCl bitcode. The same could be done with `Pico
209 * **Expected results:** Compiler ported and code generator working. Can run a
210 small benchmark of your choice.
211 * **Knowledge Prerequisite:** C, assembly, compilers.
213 .. _TCC: http://bellard.org/tcc/
214 .. _`Pico C`: https://code.google.com/p/picoc
220 PNaCl relies heavily on LLVM in two key areas:
222 * On the developer's machine, LLVM is used as a regular toolchain to parse code,
223 optimize it, and create a portable executable.
224 * On user devices, LLVM is installed as part of Chrome to translate a portable
225 executable into a machine-specific sandboxed executable.
227 Most of the contribution ideas around LLVM would occur in the upstream LLVM
228 repository, and would improve LLVM for more than just PNaCl's sake (though PNaCl
229 is of course benefiting from these improvements!). Some of these ideas would
230 also apply to Subzero_, a small and fast translator from portable executable to
231 machine-specific code.
233 .. _Subzero: https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/README.rst
235 Sandboxing Optimizations
236 ^^^^^^^^^^^^^^^^^^^^^^^^
238 * **Project:** Improved sandboxed code generation.
239 * **Brief explanation:** PNaCl generates code that targets the NaCl sandbox, but
240 this code generation isn't always optimal and sometimes results in a
241 performance lost of 10% to 25% compared to unsandboxed code. This project
242 would require looking at the x86-32, x86-64, ARM and MIPS code being generated
243 by LLVM or Subzero and figuring out how it can be improved to execute
244 faster. As an example, one could write a compiler pass to figure out when
245 doing a zero-extending ``lea`` on NaCl x86-64 would be useful (increment and
246 sandbox), or see if ``%rbp`` can be used more for loads/stores unrelated to
248 * **Expected results:** Sandboxed code runs measurably faster, and gets much
249 closer to unsandboxed code performance. PNaCl has a fairly extensive
250 performance test suite to measure these improvements.
251 * **Knowledge Prerequisite:** Compilers, assembly.
252 * **Mentor:** Jan Voung.
254 Binary Size Reduction
255 ^^^^^^^^^^^^^^^^^^^^^
257 * **Project:** Reduce the size of binaries generated by LLVM.
258 * **Brief explanation:** This is generally useful for the LLVM project, but is
259 especially important for PNaCl and Emscripten because we deliver code on the
260 Web (transfer size and compile time matter!). This stands to drastically
261 improve transfer time, and load time. Reduces the size of the PNaCl translator
262 as well as user code, makes the generated portable executables smaller and
263 translation size faster. Improve LLVM’s ``mergefuncs`` pass to reduce
264 redundancy of code. Detect functions and data that aren’t used. Improve
265 partial evaluation: can e.g. LLVM’s command-line parsing be mostly removed
266 from the PNaCl translator? Potentially add a pass where a developer manually
267 marks functions as unused, and have LLVM replace them with ``abort`` (this
268 should propagate and mark other code as dead). This list could be created by
269 using code coverage information.
270 * **Expected results:** Portable executables in the PNaCl repository are
271 measurably smaller and translate faster.
272 * **Knowledge Prerequisite:** LLVM bitcode.
273 * **Mentor:** JF Bastien.
278 * **Project:** Improve PNaCl SIMD support.
279 * **Brief explanation:** PNaCl offers speed on the Web, and generating good SIMD
280 code allows developers to use the full capabilities of the device (better user
281 experience, longer battery life). The goal of this project is to allow
282 developers to use more hardware features in a portable manner by exposing
283 portable SIMD primitives and using auto-vectorization. This could also mean
284 making the architecture-specific intrinsics “just work” within PNaCl (lower
285 them to equivalent architecture-independent intrinsics).
286 * **Expected results:** Sample code and existing applications run measurably
287 faster by using portable SIMD and/or by auto-vectorizing.
288 * **Knowledge Prerequisite:** Compilers, high-performance code tuning.
289 * **Mentor:** JF Bastien.
294 * **Project:** Improve the performance of C++11 atomics.
295 * **Brief explanation:** C++11 atomics allow programmers to shed inline assembly
296 and use language-level features to express high-performance code. This is
297 great for portability, but atomics currently aren't as fast as they could be
298 on all platforms. We had an intern work on this in the summer of 2014, see his
299 LLVM developer conference presentation `Blowing up the atomic barrier`_. This
300 project would be a continuation of this work: improve LLVM's code generation
302 * **Expected results:** Code using C++11 atomics runs measurably faster on
303 different architectures.
304 * **Knowledge Prerequisite:** Compilers, memory models.
305 * **Mentor:** JF Bastien.
307 .. _`Blowing up the atomic barrier`: http://llvm.org/devmtg/2014-10/#talk10
309 Security-enhanced PNaCl
310 ^^^^^^^^^^^^^^^^^^^^^^^
312 * **Project:** Security in-depth for PNaCl.
313 * **Brief explanation:** PNaCl brings native code to the Web, and we want to
314 improve the security of the platform as well as explore novel mitigations.
315 This allows PNaCl to take better advantage of the hardware and operating
316 system it's running on and makes the platform even faster while keeping users
317 safe. It’s also useful for non-browser uses of PNaCl such as running untrusted
318 code in the Cloud. A few areas to explore are: code randomization for LLVM and
319 Subzero, fuzzing of the translator, code hiding at compilation time, and code
320 tuning to the hardware and operating system the untrusted code is running on.
321 * **Expected results:** The security design and implementation successfully pass
322 a review with the Chrome security team.
323 * **Knowledge Prerequisite:** Security.
324 * **Mentor:** JF Bastien.
333 * **Project:** Auto-sandboxing assembler.
334 * **Brief explanation:** NaCl has a toolchain which can sandbox native
335 code. This toolchain can consume C/C++ as well as pre-sandboxed assembly, or
336 assembly which uses special sandboxing macros. The goal of this project is to
337 follow NaCl's sandboxing requirements automatically which compiling assembly
339 * **Expected results:** Existing assembly code can be compiled to a native
340 executable that follows NaCl's sandboxing rules.
341 * **Knowledge Prerequisite:** Assemblers.
342 * **Mentor:** Derek Schuff, Roland McGrath.
347 * **Project:** Create a new software-fault isolation sandbox.
348 * **Brief explanation:** NaCl pioneered production-quality sandboxes based on
349 software-fault isolation, and currently supports x86-32, x86-64, ARMv7's ARM,
350 and MIPS. This project involves designing and implementing new sandboxes. Of
351 particular interest are ARMv8's aarch64 and Power8. This also requires
352 implementing sandboxing in the compiler.
353 * **Expected results:** The new sandbox's design and implementation successfully
354 pass a review with the Chrome security team. Existing NaCl code successfully
355 runs in the new sandbox.
356 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
357 * **Mentor:** David Sehr.
362 * **Project:** Create a 64-bit sandbox.
363 * **Brief explanation:** NaCl currently supports sandboxes where pointers are
364 32-bits. Some applications, both in-browser and not in-browser, would benefit
365 from a larger address space. This project involves designing and implementing
366 a model for 64-bit sandboxes on all architecture NaCl currently supports. This
367 also requires supporting 64-bit pointers in PNaCl using the ``le64`` platform,
368 and updating the code generation for each platform.
369 * **Expected results:** The new sandbox's design and implementation successfully
370 pass a review with the Chrome security team. Existing NaCl code successfully
371 runs in the new sandbox.
372 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
373 * **Mentor:** David Sehr.