[GSoC] [RFC] Proposal: A C++11 enabled TMP library
Hi, As suggested earlier on this list, I am posting my GSoC proposal here in an attempt to gather comments and to improve the proposal. Basically, if you would not give the proposal 10/10, then I would like to know the reason so I can change it accordingly. I am strongly motivated with this project and I want to maximize my chances of getting in. The proposal is written in Markdown because that's easier to read than plain text; it is available here (secret gists are just hidden from search engines): http://gist.github.com/ldionne/d05528280db79105e30d Please post all constructive comments that come to your mind. Thank you, Louis Dionne
On 11 Mar 2014 at 16:22, Louis Dionne wrote:
http://gist.github.com/ldionne/d05528280db79105e30d
Please post all constructive comments that come to your mind.
Can you list a proposed set of summer work items please? For example, you might implement a TMP vector type list with documentation and functional tests with Travis CI per-commit testing? Don't worry about peer review, or mention it except as an aside. GSoC doesn't care about Boost peer review processes. Niall --- Boost C++ Libraries Google Summer of Code 2014 admin https://svn.boost.org/trac/boost/wiki/SoC2014
Niall Douglas
Can you list a proposed set of summer work items please? For example, you might implement a TMP vector type list with documentation and functional tests with Travis CI per-commit testing?
Don't worry about peer review, or mention it except as an aside. GSoC doesn't care about Boost peer review processes.
Since my proposal is very dependent upon the result of the peer review process, I am not sure what I should list. Should I suppose scenario (1) or scenario (2)? Or should I consider both scenarios but be more concise and drop all the explanations of scenario (1)? In other words, should I list work items on the MPL, the MPL11 or both? Regards, Louis Dionne
On 12 Mar 2014 at 0:32, Louis Dionne wrote:
Can you list a proposed set of summer work items please? For example, you might implement a TMP vector type list with documentation and functional tests with Travis CI per-commit testing?
Don't worry about peer review, or mention it except as an aside. GSoC doesn't care about Boost peer review processes.
Since my proposal is very dependent upon the result of the peer review process, I am not sure what I should list. Should I suppose scenario (1) or scenario (2)? Or should I consider both scenarios but be more concise and drop all the explanations of scenario (1)? In other words, should I list work items on the MPL, the MPL11 or both?
Remember Google don't care about Boost peer review. To them it is unimportant. Google only fund the writing of concrete bits of code - in fact, you will have to supply samples of what you wrote to Google at the end of GSoC. It's very simple: If you weren't in GSoC this summer, I'd assume you'd spend your summer working on your TMP library anyway. So simply list what you hope to finish this summer, and propose the first half of that for GSoC as concrete items and the second half as optional "would like if have time" items. Post that here when you're done. Niall --- Boost C++ Libraries Google Summer of Code 2014 admin https://svn.boost.org/trac/boost/wiki/SoC2014
Niall Douglas
It's very simple: If you weren't in GSoC this summer, I'd assume you'd spend your summer working on your TMP library anyway. So simply list what you hope to finish this summer, and propose the first half of that for GSoC as concrete items and the second half as optional "would like if have time" items. Post that here when you're done.
First, thank you for taking your time to help me.
Here is the list of MPL11-related tasks I plan to clear during the summer.
Note that full unit testing and documentation is implied for each task.
- 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.
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 a tutorial that does not only present the core concepts of the
library, but really shows how to use it for concrete tasks.
- Setup a Boost-compatible build system; the library currently uses CMake.
- Design a cross-tag dispatching system for binary metafunctions (probably
following N3351). This is a bit like the mixed-type numeric metafunctions
of the MPL, except it should work with arbitrary (non-numeric) types and
metafunctions.
- Design a small DSL to write inline metafunction classes. This is pretty
much like lambda expressions in the MPL, but:
- It should be possible to refer to arguments in an outer scope. This
issue can be addressed either by let-expressions or De Bruijn indices.
- It should be possible and easy to define custom placeholders.
- It should be possible to have variadic placeholders, i.e. placeholders
that are replaced by more than one argument. Note that this is tricky
because the template in which the placeholder appears might not have
the arity required to perform the substitution.
These are optional tasks I would like to complete if I have the time. Again,
each task implies full unit testing and documentation.
- Make std::tuple, MPL sequences and Fusion sequences valid MPL11 sequences,
so they can be used in MPL11 algorithms.
- Implement pattern matching on template specializations, much like
Proto's match<> but for arbitrary template specializations. Pattern
modifiers should be provided. At the minimum:
- or_
On 12 Mar 2014 at 3:11, Louis Dionne wrote:
Here is the list of MPL11-related tasks I plan to clear during the summer. Note that full unit testing and documentation is implied for each task.
- 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.
Nice.
- Implement a compile-time map and a compile-time set with variadic templates. 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?
Nice.
- Write numeric metafunctions that can perform efficiently on homogeneous sequences of integral constants (using constexpr).
Nice.
- Write a tutorial that does not only present the core concepts of the library, but really shows how to use it for concrete tasks.
Mmm. Very worthy in itself, but better as an "if time permits" addon for GSoC purposes.
- Setup a Boost-compatible build system; the library currently uses CMake.
Nice.
- Design a cross-tag dispatching system for binary metafunctions (probably following N3351). This is a bit like the mixed-type numeric metafunctions of the MPL, except it should work with arbitrary (non-numeric) types and metafunctions.
- Design a small DSL to write inline metafunction classes. This is pretty much like lambda expressions in the MPL, but: - It should be possible to refer to arguments in an outer scope. This issue can be addressed either by let-expressions or De Bruijn indices. - It should be possible and easy to define custom placeholders. - It should be possible to have variadic placeholders, i.e. placeholders that are replaced by more than one argument. Note that this is tricky because the template in which the placeholder appears might not have the arity required to perform the substitution.
I feel hesitancy with anything you have yet to design. Also, I personally think your earlier work items are already more than plenty for a GSoC which really is not very long. GSoC uses a US summer schedule, we here in Europe get much longer summer holidays (equally, the Chinese get less than the US).
These are optional tasks I would like to complete if I have the time. Again, each task implies full unit testing and documentation.
- Make std::tuple, MPL sequences and Fusion sequences valid MPL11 sequences, so they can be used in MPL11 algorithms.
Very nice. You're getting me very excited about MPL11 now.
- Implement pattern matching on template specializations, much like Proto's match<> but for arbitrary template specializations. Pattern modifiers should be provided. At the minimum: - or_
matches if any of the Patterns match. - and_ matches if all of the Patterns match. - not_<Pattern> matches if the Pattern does not match. - when<F> matches if apply ::type::value is true, where T is the expression being matched against.
Could be a great stop gap before Concepts Lite arrives.
- Implement a compile-time graph data structure. 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
Hehehe ... colour me extremely interested now.
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.
Superb Louis. With Joel as prospective mentor, this is exactly the kind of GSoC we look for at Boost. Knock the above list into a proposal according to Google's proposal template, send it here and I think not long after you're ready to submit. Niall --- Boost C++ Libraries Google Summer of Code 2014 admin https://svn.boost.org/trac/boost/wiki/SoC2014
Niall Douglas
I feel hesitancy with anything you have yet to design. Also, I personally think your earlier work items are already more than plenty for a GSoC which really is not very long. GSoC uses a US summer schedule, we here in Europe get much longer summer holidays (equally, the Chinese get less than the US).
Alright, I removed those two tasks.
- Make std::tuple, MPL sequences and Fusion sequences valid MPL11 sequences, so they can be used in MPL11 algorithms.
Very nice. You're getting me very excited about MPL11 now.
Since it is not too daunting, I made this a non-optional task.
Superb Louis. With Joel as prospective mentor, this is exactly the kind of GSoC we look for at Boost. Knock the above list into a proposal according to Google's proposal template, send it here and I think not long after you're ready to submit.
My full proposal follows the Boost template available here:
https://svn.boost.org/trac/boost/wiki/SoCSubmissionTemplate
Here we go. It's rather long, sorry if you meant that I should only
post a link to it.
------------------------------------------------------------------------------
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. Note that full unit testing and documentation is implied for
each task.
- 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.
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).
- 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.
What follow is a list of optional tasks I would like to complete if I have
the time. Again, each task implies full unit testing and documentation.
- 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, much like
Proto's match<> but for arbitrary template specializations. Pattern
modifiers should be provided. At the minimum:
- or_
On 12 Mar 2014 at 16:47, Louis Dionne wrote:
Concretely, here is a list of MPL11-related tasks I plan to clear during the summer. Note that full unit testing and documentation is implied for each task.
I hate to be a bore, but I'd actually say "with full unit testing and documentation" for every single item individually. That's because people tend to scan GSoC proposals quickly, not really reading it. Remember we get in about 120 proposals each year.
What follow is a list of optional tasks I would like to complete if I have the time. Again, each task implies full unit testing and documentation.
Add "and in consultation with my mentor(s)". And again mention the unit testing and documentation every item.
- Availability: I can start working a couple hours per week right now (I already do). However, full-time work should wait before the end of C++Now, which is May, 18. As for the stop date, I would go with the suggested date, which is August, 11.
Slightly change this: make the period from the start of GSoC up to C++Now being preparing your GSoC for presentation to the Boost community at C++Now (explain this is "the Boost conference"), and for which you'll be working 40 hours a week except where exams intrude.
The only factor limiting my availability is that I would like to take a vacation of perhaps one week or so during the summer. However, if I am not required to be super-available between the "pencils down" date and the final results announcement, then I can take my vacation at that time.
Mentioning vacations to GSoC is a bad idea. They're US, and in the US culture you're always going to work 70 hour weeks seven days a week, whether you actually do or not is not important. Also, any time off you take is really a matter between you and your mentor. Google need not to be worried about it. Last year, for example, I gave Paul a long weekend off because he would have burned out without the rest and/or his fiancee wouldn't be his fiancee any more! I'd delete any mention of vacations if I were you.
As always, comments are welcome!
With the above changes, I think you're ready to submit a proposal. Well done Louis. Niall --- Boost C++ Libraries Google Summer of Code 2014 admin https://svn.boost.org/trac/boost/wiki/SoC2014
Niall Douglas
I hate to be a bore, but I'd actually say "with full unit testing and documentation" for every single item individually. That's because people tend to scan GSoC proposals quickly, not really reading it. Remember we get in about 120 proposals each year.
Done.
What follow is a list of optional tasks I would like to complete if I have the time. Again, each task implies full unit testing and documentation.
Add "and in consultation with my mentor(s)". And again mention the unit testing and documentation every item.
Done.
Slightly change this: make the period from the start of GSoC up to C++Now being preparing your GSoC for presentation to the Boost community at C++Now (explain this is "the Boost conference"), and for which you'll be working 40 hours a week except where exams intrude.
Done.
The only factor limiting my availability is that I would like to take a vacation of perhaps one week or so during the summer. However, if I am not required to be super-available between the "pencils down" date and the final results announcement, then I can take my vacation at that time.
I'd delete any mention of vacations if I were you.
Alright, then I'll hope my mentor is indulgent.
With the above changes, I think you're ready to submit a proposal.
Thank you for your help. The final proposal is at [1] if someone wants to read it. Comments are still welcome; otherwise I'll send the application in a couple of days. Louis [1]: https://gist.github.com/ldionne/d05528280db79105e30d
participants (2)
-
Louis Dionne
-
Niall Douglas