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 We've separated contributor ideas into broad areas of interest:
36 * **Ports** encompass all the code that *uses* the PNaCl platform. Put simply,
37 the point of ports is to make existing open-source code work.
38 * **Programming languages** sometimes involves compiler work, and sometimes
39 requires getting an interpreter and its APIs to work well within the Web
41 * **LLVM and PNaCl** requires compiler work: PNaCl is based on the LLVM
42 toolchain, and most of the work in this area would occur in the upstream LLVM
44 * **NaCl** mostly deals with low-level systems work and security.
48 Adding a proposal to this document should follow this format:
49 Project: *project title*
50 Brief explanation: *brief description*
51 Expected results: *how do we evaluate the project's success?*
52 Knowledge Prerequisite: *programming languages, CS topics, ...*
53 Mentor: *one or multiple, their roles in this project*
54 The above list is inspired by the Google Summer of Code guidelines, and the
63 * **Project:** Expose new filesystems to :doc:`nacl_io
64 </devguide/coding/nacl_io>`.
65 * **Brief explanation:** nacl_io exposes filesystems like html5fs and RAM disk,
66 which can be mounted and then accessed through regular POSIX APIs. New types
67 of filesystems could be exposed in a similar way, allowing developers to build
68 apps that "just work" on the Web platform while using Web APIs. A few ideas
69 include connecting to: Google Drive, Github, Dropbox.
70 * **Expected results:** A new filesystem is mountable using nacl_io, is well
71 tested, and used in a demo application.
72 * **Knowledge Prerequisite:** C++.
73 * **Mentor:** Sam Clegg.
78 * **Project:** Port substantial open source projects to work in naclports.
79 * **Brief explanation:** naclports contains a large collection of open source
80 projects that properly compile and run on the PNaCl platform. This project
81 involves adding new useful projects to naclports, and upstreaming any patches
82 to the original project: running on PNaCl effective involves porting to a new
83 architecture and operating system. Project ideas include: Gimp, Inkscape, Gtk.
84 * **Expected results:** New open source projects are usable from naclports.
85 * **Knowledge Prerequisite:** C/C++.
86 * **Mentor:** Brad Nelson.
92 PNaCl already has support for C and C++, and virtual machines such as
93 JavaScript, Lua, Python and Ruby. We'd like to support more languages, either by
94 having these languages target LLVM bitcode or by making sure that the language
95 virtual machine's APIs work well on the Web platform.
100 * **Project:** Support the Rust programming languages.
101 * **Brief explanation:** The Rust_ programming language uses LLVM. The aim of
102 this project is to allow it to deliver PNaCl ``.pexe`` files.
103 * **Expected results:** The Rust test suite passes within the browser. How to
104 use Rust to target PNaCl is well documented and easy to do.
105 * **Knowledge Prerequisite:** Compilers, LLVM.
106 * **Mentor:** Ben Smith.
108 .. _Rust: http://www.rust-lang.org
113 * **Project:** Support the Haskell programming language.
114 * **Brief explanation:** GHC_ targets LLVM. The aim of this project is to allow
115 it to deliver PNaCl ``.pexe`` files. One interesting difficulty will be to
116 ensure that tail call optimization occurs properly in all targets.
117 * **Expected results:** The Haskell test suite passes within the browser. How to
118 use Haskell to target PNaCl is well documented and easy to do.
119 * **Knowledge Prerequisite:** Compilers, LLVM.
120 * **Mentor:** Ben Smith.
123 http://www.haskell.org/ghc/docs/latest/html/users_guide/code-generators.html
128 * **Project:** Support the Julia programming language.
129 * **Brief explanation:** Julia_ targets LLVM, but it does so through LLVM's
130 Just-in-Time compiler which PNaCl doens't support. The aim of this project is
131 to allow it to deliver PNaCl ``.pexe`` files.
132 * **Expected results:** The Julia test suite passes within the browser. How to
133 use Julia to target PNaCl is well documented and easy to do.
134 * **Knowledge Prerequisite:** Compilers, LLVM.
135 * **Mentor:** Ben Smith.
137 .. _Julia: http://julialang.org
142 * **Project:** Support the Scala programming language.
143 * **Brief explanation:** The aim of this project is to allow Scala_ to deliver
144 PNaCl ``.pexe`` files.
145 * **Expected results:** The Scala test suite passes within the browser. How to
146 use Scala to target PNaCl is well documented and easy to do.
147 * **Knowledge Prerequisite:** Compilers.
148 * **Mentor:** Ben Smith.
150 .. _Scala: http://www.scala-lang.org
155 * **Project:** Support the Elm programming language.
156 * **Brief explanation:** The aim of this project is to allow Elm_ to deliver
157 PNaCl ``.pexe`` files.
158 * **Expected results:** The Elm test suite passes within the browser. How to use
159 Elm to target PNaCl is well documented and easy to do.
160 * **Knowledge Prerequisite:** Compilers.
161 * **Mentor:** Jan Voung.
163 .. _Elm: http://elm-lang.org
168 * **Project:** Support C# running inside Mono.
169 * **Brief explanation:** C# is traditionally a Just-in-Time compiled language,
170 the aim of this project is to be able to run C# code withing Mono_ while
171 compiling ahead-of-time.
172 * **Expected results:** The Mono test suite passes within the browser. How to
173 use Mono to target PNaCl is well documented and easy to do.
174 * **Knowledge Prerequisite:** Compilers.
175 * **Mentor:** Derek Schuff.
177 .. _Mono: http://www.mono-project.com
182 * **Project:** Support Perl.
183 * **Brief explanation:** Port the Perl programming language and its packages to
185 * **Expected results:** The Perl test suite passes within the browser. How to
186 use Perl to target PNaCl is well documented and easy to do.
187 * **Knowledge Prerequisite:** C.
188 * **Mentor:** Brad Nelson.
193 * **Project:** Port Fabrice Ballard's Tiny C Compiler _TCC to NaCl and PNaCl.
194 * **Brief explanation:** Port TCC to NaCl and enhance to follow NaCl sandboxing
195 rule, as well as emitting PNaCl bitcode. The same could be done with `Pico
197 * **Expected results:** Compiler ported and code generator working. Can run a
198 small benchmark of your choice.
199 * **Knowledge Prerequisite:** C, assembly, compilers.
201 .. _TCC: http://bellard.org/tcc/
202 .. _`Pico C`: https://code.google.com/p/picoc
208 PNaCl relies heavily on LLVM in two key areas:
210 * On the developer's machine, LLVM is used as a regular toolchain to parse code,
211 optimize it, and create a portable executable.
212 * On user devices, LLVM is installed as part of Chrome to translate a portable
213 executable into a machine-specific sandboxed executable.
215 Most of the contribution ideas around LLVM would occur in the upstream LLVM
216 repository, and would improve LLVM for more than just PNaCl's sake (though PNaCl
217 is of course benefiting from these improvements!). Some of these ideas would
218 also apply to Subzero_, a small and fast translator from portable executable to
219 machine-specific code.
221 .. _Subzero: https://chromium.googlesource.com/native_client/pnacl-subzero/+/master/README.rst
223 Sandboxing Optimizations
224 ^^^^^^^^^^^^^^^^^^^^^^^^
226 * **Project:** Improved sandboxed code generation.
227 * **Brief explanation:** PNaCl generates code that targets the NaCl sandbox, but
228 this code generation isn't always optimal and sometimes results in a
229 performance lost of 10% to 25% compared to unsandboxed code. This project
230 would require looking at the x86-32, x86-64, ARM and MIPS code being generated
231 by LLVM or Subzero and figuring out how it can be improved to execute
232 faster. As an example, one could write a compiler pass to figure out when
233 doing a zero-extending ``lea`` on NaCl x86-64 would be useful (increment and
234 sandbox), or see if ``%rbp`` can be used more for loads/stores unrelated to
236 * **Expected results:** Sandboxed code runs measurably faster, and gets much
237 closer to unsandboxed code performance. PNaCl has a fairly extensive
238 performance test suite to measure these improvements.
239 * **Knowledge Prerequisite:** Compilers, assembly.
240 * **Mentor:** Jan Voung.
242 Binary Size Reduction
243 ^^^^^^^^^^^^^^^^^^^^^
245 * **Project:** Reduce the size of binaries generated by LLVM.
246 * **Brief explanation:** This is generally useful for the LLVM project, but is
247 especially important for PNaCl and Emscripten because we deliver code on the
248 Web (transfer size and compile time matter!). This stands to drastically
249 improve transfer time, and load time. Reduces the size of the PNaCl translator
250 as well as user code, makes the generated portable executables smaller and
251 translation size faster. Improve LLVM’s ``mergefuncs`` pass to reduce
252 redundancy of code. Detect functions and data that aren’t used. Improve
253 partial evaluation: can e.g. LLVM’s command-line parsing be mostly removed
254 from the PNaCl translator? Potentially add a pass where a developer manually
255 marks functions as unused, and have LLVM replace them with ``abort`` (this
256 should propagate and mark other code as dead). This list could be created by
257 using code coverage information.
258 * **Expected results:** Portable executables in the PNaCl repository are
259 measurably smaller and translate faster.
260 * **Knowledge Prerequisite:** LLVM bitcode.
261 * **Mentor:** JF Bastien.
266 * **Project:** Improve PNaCl SIMD support.
267 * **Brief explanation:** PNaCl offers speed on the Web, and generating good SIMD
268 code allows developers to use the full capabilities of the device (better user
269 experience, longer battery life). The goal of this project is to allow
270 developers to use more hardware features in a portable manner by exposing
271 portable SIMD primitives and using auto-vectorization. This could also mean
272 making the architecture-specific intrinsics “just work” within PNaCl (lower
273 them to equivalent architecture-independent intrinsics).
274 * **Expected results:** Sample code and existing applications run measurably
275 faster by using portable SIMD and/or by auto-vectorizing.
276 * **Knowledge Prerequisite:** Compilers, high-performance code tuning.
277 * **Mentor:** JF Bastien.
282 * **Project:** Improve the performance of C++11 atomics.
283 * **Brief explanation:** C++11 atomics allow programmers to shed inline assembly
284 and use language-level features to express high-performance code. This is
285 great for portability, but atomics currently aren't as fast as they could be
286 on all platforms. We had an intern work on this in the summer of 2014, see his
287 LLVM developer conference presentation `Blowing up the atomic barrier`_. This
288 project would be a continuation of this work: improve LLVM's code generation
290 * **Expected results:** Code using C++11 atomics runs measurably faster on
291 different architectures.
292 * **Knowledge Prerequisite:** Compilers, memory models.
293 * **Mentor:** JF Bastien.
295 .. _`Blowing up the atomic barrier`: http://llvm.org/devmtg/2014-10/#talk10
297 Security-enhanced PNaCl
298 ^^^^^^^^^^^^^^^^^^^^^^^
300 * **Project:** Security in-depth for PNaCl.
301 * **Brief explanation:** PNaCl brings native code to the Web, and we want to
302 improve the security of the platform as well as explore novel mitigations.
303 This allows PNaCl to take better advantage of the hardware and operating
304 system it's running on and makes the platform even faster while keeping users
305 safe. It’s also useful for non-browser uses of PNaCl such as running untrusted
306 code in the Cloud. A few areas to explore are: code randomization for LLVM and
307 Subzero, fuzzing of the translator, code hiding at compilation time, and code
308 tuning to the hardware and operating system the untrusted code is running on.
309 * **Expected results:** The security design and implementation successfully pass
310 a review with the Chrome security team.
311 * **Knowledge Prerequisite:** Security.
312 * **Mentor:** JF Bastien.
321 * **Project:** Auto-sandboxing assembler.
322 * **Brief explanation:** NaCl has a toolchain which can sandbox native
323 code. This toolchain can consume C/C++ as well as pre-sandboxed assembly, or
324 assembly which uses special sandboxing macros. The goal of this project is to
325 follow NaCl's sandboxing requirements automatically which compiling assembly
327 * **Expected results:** Existing assembly code can be compiled to a native
328 executable that follows NaCl's sandboxing rules.
329 * **Knowledge Prerequisite:** Assemblers.
330 * **Mentor:** Derek Schuff, Roland McGrath.
335 * **Project:** Create a new software-fault isolation sandbox.
336 * **Brief explanation:** NaCl pioneered production-quality sandboxes based on
337 software-fault isolation, and currently supports x86-32, x86-64, ARMv7's ARM,
338 and MIPS. This project involves designing and implementing new sandboxes. Of
339 particular interest are ARMv8's aarch64 and Power8. This also requires
340 implementing sandboxing in the compiler.
341 * **Expected results:** The new sandbox's design and implementation successfully
342 pass a review with the Chrome security team. Existing NaCl code successfully
343 runs in the new sandbox.
344 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
345 * **Mentor:** David Sehr.
350 * **Project:** Create a 64-bit sandbox.
351 * **Brief explanation:** NaCl currently supports sandboxes where pointers are
352 32-bits. Some applications, both in-browser and not in-browser, would benefit
353 from a larger address space. This project involves designing and implementing
354 a model for 64-bit sandboxes on all architecture NaCl currently supports. This
355 also requires supporting 64-bit pointers in PNaCl using the ``le64`` platform,
356 and updating the code generation for each platform.
357 * **Expected results:** The new sandbox's design and implementation successfully
358 pass a review with the Chrome security team. Existing NaCl code successfully
359 runs in the new sandbox.
360 * **Knowledge Prerequisite:** Security, low-level assembly, compilers, LLVM.
361 * **Mentor:** David Sehr.