Skip to content

Instantly share code, notes, and snippets.

@ldionne
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ldionne/d05528280db79105e30d to your computer and use it in GitHub Desktop.
Save ldionne/d05528280db79105e30d to your computer and use it in GitHub Desktop.
GSoC 2014 Proposal for Boost
Background information
======================
I am an undergraduate in mathematics with a passion for programming.
My educational and programming backgrounds are summarized on my resume [1].
I could write those here, but that would be redundant.
My main programming interests are metaprogramming and functional programming
in C++ or other languages (Haskell, Python). I usually love it when there
are some abstract mathematics hidden somewhere, so I search for that. I am
interested in contributing to Boost because of the quality of what gets in
there. One of my primary goals at this (early) stage of my life is to get
better. Hence, having to satisfy very high standards is a good thing.
The project I am proposing aims to provide a high quality C++11-enabled TMP
library. I have been thinking about that for about two years, and I have been
working actively on a potential successor to the MPL named MPL11 [2] for about
9 months. I have looked extensively at other libraries with a similar purpose
to make sure I was constantly aware of the state of the art.
But why would Boost want a C++11-enabled TMP library? First, we can improve
the compile-time performance of some algorithms by using variadic templates
and/or constexpr wisely. Also, a C++11 TMP library could be much lighter to
include; as an example, including all the MPL11 is ~35x faster than including
all the MPL, yet they provide similar functionality. However, compilation time
is not the only improvement in C++11; several constructs become easier to use
(say goodbye to vectorN and friends) and errors become easier to decipher
because we do not need to emulate variadic templates.
Project proposal
================
Concretely, here is a list of MPL11-related tasks I plan to clear during
the summer.
- Write a suite of benchmarks to compare the compilation time and memory
usage of different TMP techniques. The benchmarks should run automatically
on different input datasets and produce charts for easy comparison. This
can be done with e.g. Ruby and a Ruby binding for Gnuplot.
- Implement a compile-time map and a compile-time set with variadic templates,
with full unit testing and documentation. Several implementation techniques
should be tested and benchmarked to pick the best one. For the interface,
I'm thinking about an something similar to Haskell's Data.Map.Strict for
the map and to Data.Set for the set. Note that I will have to decide what
kind of type equality to support: type identity or "deep" type equivalence?
- Write numeric metafunctions that can perform efficiently on homogeneous
sequences of integral constants (using constexpr). Write documentation,
unit tests and benchmark the metafunctions to make sure there's an
improvement over a naive implementation.
- Setup a Boost-compatible build system; the library currently uses CMake.
- Make std::tuple, MPL sequences and Fusion sequences valid MPL11 sequences,
so they can be used in MPL11 algorithms. Test and document the adapted
components.
What follows is a list of optional tasks I would like to complete if I have
the time, and in consultation with my mentor(s).
- Write a tutorial that does not only present the core concepts of the
library, but really shows how to use it for concrete tasks.
- Implement pattern matching on template specializations with unit tests and
documentation. This is much like Proto's match<> but for arbitrary template
specializations. Pattern modifiers should be provided. At the minimum:
- or_<Patterns...> matches if any of the Patterns match.
- and_<Patterns...> matches if all of the Patterns match.
- not_<Pattern> matches if the Pattern does not match.
- when<F> matches if apply<F, T>::type::value is true, where T is
the expression being matched against.
- Implement a compile-time graph data structure with unit tests and
documentation. The graph should support an interface similar to
Boost.Graph's adjacency_list. Some basic graph algorithms should
also be provided. At the minimum:
- depth-first search
- breadth-first search
- topological sort
- transitive closure
This is useful e.g. to order the execution of computations at compile-time.
By creating a compile-time graph where nodes are computations and edges are
dependencies between them, one can determine which computations can be
parallelized and which ones must be linearized.
Proposed milestones and schedule
================================
April 22: Start working on my GSoC presentation at C++Now 2014 [3] and on the
benchmark suite, which I need for the presentation. C++Now is a
Boost-centric conference held every year in Aspen; I will be
presenting the MPL11 this year [4].
May 18: End of the C++Now conference. Start implementing the compile-time
map and set. Use the benchmark suite to help determine the best
implementation techniques.
June 8: Start implementing numeric metafunctions. Again, use the benchmark
suite to make sure I'm not doing de-optimization.
June 23: Submit midterm evaluations to Google.
July 1: Setup a Boost-compatible build system. This should not be too long.
Right after, start making MPL and Fusion compatible with MPL11.
July 15: Finish non-optional tasks if that's not done. Otherwise start
working on optional tasks. Which optional tasks I start with
could depend on what the community wants the most and discussion
with my mentor(s).
August 11: Pencils down date. Last-minute polishing.
August 18: Submit final evaluation to Google.
Personal details
================
- Name: Louis Dionne
- University: Laval University (Québec, Canada)
- Major: Mathematics
- Degree program: B.Sc.
- Email: ldionne.2@gmail.com
- Homepage: ldionne.com
- Availability:
From April 22 to May 1, I will work as much as my duties as a student
allow me to. After May 1, I can work full-time for the whole summer until
around August 11, as suggested. I don't have a hard limit though, so I can
extend that date as required.
- Knowledge of (from 0 to 5):
+ C++: 3.5
+ C++ Standard Library: 3.5
+ Boost: 3.5
+ Subversion: 1 (I'm sold to git!)
+ Doxygen: 3.5
+ Quickbook: 1
+ CMake: 3.5
I use the SublimeText editor on OS X and compile by hand. Seriously though,
I use GCC 4.9.0 and Clang 3.5 on the command line.
[1]: http://ldionne.com/resume.pdf
[2]: http://github.com/ldionne/mpl11
[3]: http://cppnow.org
[4]: http://cppnow2014.sched.org/speaker/ldionne
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment