Changes between Initial Version and Version 1 of soc/2007/ExtensionAndReflection


Ignore:
Timestamp:
May 22, 2007, 1:19:03 PM (15 years ago)
Author:
Hartmut Kaiser
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • soc/2007/ExtensionAndReflection

    v1 v1  
     1== Abstract ==
     2
     3The project that I propose is centered in adding to Boost a library that allows the programmer to include extensions/plugins. Additionally this will be the start point to implement reflection concepts.
     4
     5My proposal has two parts:
     6
     71. Bring Boost.Extensions [1] to completion and enhance it
     8
     9   As I will say in the next sections, I wanted to add to Boost a library that allows an application to have dynamic plugins/extensions within an infrastructure.
     10
     11   A member of the Boost mailing list told me about a library by Jeremy Pack called Extension. Jeremy and I agreed that the best approach would be to complete and enhance this library. In short, the
     12completion consists in preparing the library to be sent for review in Boost. The enhancements are several, and will be described later.
     13
     142. Implement Reflection [2] using Extensions functionality
     15
     16   The Extensions functionality is the perfect platform to implement Reflection in C++. I've analyzed several papers about this topic and having Extensions complete will be great to start building this new features. Also, the Boost Community showed a great interest saying that it would be a great addition to Boost. Discussing Reflection with Jeremy we agreed that it could be very useful to use the dynamic (run-time) method loading features in Extensions to give reflection functionality to normal C++ classes. I'll detail this point later.
     17
     18== Proposal history ==
     19
     20Last year, I've been working in a GIS project. It needed a very open architecture, and our decision was
     21to implement some kind of software plugin infrastructure. This project was being written in C++ and with a
     22very intensive use of Boost. At that point, I checked out if Boost had a Plugin Library.... without results.
     23
     24So I designed and implemented an original infrastructure. It was useful and I've learnt a lot during
     25the development. Also I've noted its pros/cons.
     26
     27Since that time, I have been thinking about adding an Extensions library to Boost, because I really like
     28Boost philosophy, and I use it very frequently (nowadays I'm using it in at least three C++ projects,
     29and advocating its use to my colleagues).
     30
     31Luckily, Summer of Code 2007 was about to start. Then I tried to get in touch with the boost community. Since
     32early March I've been discussing my ideas in the lists with positive feedback. They showed a lot of interest
     33and, as I said before, quickly pointed me out that there was some work done in that area. With more luck,
     34Jeremy contacted me very quickly.
     35
     36We started to work together that week. I started to review his approach and he checked some of my
     37old code. Obviously, his approach is simpler, more concrete and really clean. He told me that my code was
     38very clear too, comparing it with another libraries.
     39
     40Then, we started to set the concrete goals for the project. The result of that work is this proposal.
     41
     42
     43== Detailed objectives ==
     44
     45Objectives could be split in two parts. My first goal is to bring to completion Boost.Extensions and then
     46explore Reflection functionalities.
     47
     48Some of the improvements that are needed to complete Boost.Extensions (in order to submit it
     49for revision) were addressed in our work with Jeremy. I think that some more will appear when
     50we start the work.
     51
     52Then the actual tasks of this part are:
     53
     541. Preprocessor techniques to remove template redundancy. Nowadays some parts of the library
     55are duplicated because the use of variable-arguments templates. The idea is to use
     56the preprocessor library to avoid this. I've done it in another project, so I think that it'll
     57be easy (but costly).
     58
     592. Provide (optionally) automatic closing of unneeded linked libraries. We think that
     60this feature is important for many people to justify adding it in the standard library.
     61Also, it can be added with 'convenience' functions quite smoothly - just as smoothly as
     62directly adding the functionality.
     63
     643. Various integrations with other Boost libraries for convenience (like boost::function).
     65
     664. Finish up documentation.
     67
     685. Write lots of more unit tests, as well as larger tests.
     69
     706. Submit to Boost for review.
     71
     72Having that complete, I'll focus on the Reflection part. My main idea is allow the C++ programmer to
     73access a meta-level infrastructure where he/she can load new classes/methods at run-time and get
     74information about them.
     75
     76For that purpose I need to define an API that allows exporting methods and then the infrastructure
     77to load them on demand. The difference with the Extensions approach is that in this part this methods
     78won't be a virtual function declared in a base class. I mean, you should export the methods that could
     79be used to access this meta-level and then Extensions will have the responsibility of loading the
     80necessary dynamic shared objects. Additionally, this will allow creating objects that aren't derived
     81of any class of the executable; instead they are loaded on demand from a linked library.
     82
     83A possible use of this API could be, for example, the development of a C++ 'interpreter'.
     84
     85Another interesting line of work could be having the ability to compile code at runtime and use it
     86( i.e. compile it into a linked library and link to it at runtime). If bjam was required to be in the path,
     87and BOOST_BUILD_PATH was all set up, this just might work well.
     88
     89I know that this objectives are big but really interesting. I'll detail in the schedule and deliverables section
     90what I want to achieve for sure, and what could be developed if the time allows me.
     91
     92
     93== Schedule ==
     94
     95 * Weeks in the interim period between being accepted as student and program start
     96
     97   Try to get more and more feedback from the community and try to detail the
     98plan with Jeremy and my mentor. Maybe some prototype could be done
     99if I have spare time.
     100
     101 * Week 1
     102
     103   Do a careful study of Boost.Extensions. I've checked it out, but I need a deep
     104understanding before starting. Get in touch with my mentor (as with Jeremy I'm
     105in touch nowadays). See carefully the requirements to review the library.
     106
     107 * Weeks 2 - 4
     108
     109   First tasks, 1. to 3., and task 5. Initial unit tests will be written.
     110
     111 * Weeks 5 - 6
     112
     113   Finish the first part (tasks 4. to 6.), submitting the library to boost for revision.
     114
     115 * Weeks 7 - 8
     116
     117   Explore reflection and do the first prototypes of the functionalities. Make
     118some units tests along the development.
     119
     120 * Weeks 9 - 10
     121
     122   Go on with reflection, trying to fit it as a working and useful library.
     123
     124 * Weeks 11 - 12
     125
     126   Fix bugs. Document. Make more unit tests. According to the remaining time add some
     127functionalities of the other optional tasks. Plan the future after-program work.
     128
     129== References ==
     130
     131[1] Boost.Extension: [http://sourceforge.net/projects/boost-extension/]
     132
     133[2] Some reflection ideas: [http://www.vollmann.com/pubs/meta/meta/meta.html]
     134
     135[3] Boost mailing list
     136 * [http://article.gmane.org/gmane.comp.lib.boost.devel/155445]
     137 * [http://archives.free.net.ph/thread/20070314.225134.19510931.en.html]