PCL - Portable C++ Library

Hi all, ( Maybe it's an OFF-TOPIC (Sorry) ) At the GoingNative2012 conference, Herb Sutter said that the main disadvantage of C++ today is the lack of a standard library (like dotNet or Java frameworks) He called people to propose additions, like REST Webservices, Async I/O, XML/JSON, ... On the other hand, a member of the public claimed for a desired feature for C++. The answer (can't remember if it was Herb or Bjarne) was to send the paper to WG21 and attend committee meetings to defend his proposal. This is what almost everyone already know about the way WG21 works. I'm not a member of the Committee, or of any company/organization that has an interest in it (Boost, Google, Microsoft, Apple,...) The question is, how I can do to attend meetings? I have no time available or money to pay me the trip myself. Consequently, I see no possibility to attend meetings, then, I have no possibility to defend an idea. Am I wrong? Perhaps this question is for the Committee members (Beman, Dave, Andrew ...) Is there a way to send a proposal and defend it without having to attend meetings? On the other hand, I would like to have access to the discussions (mailing list). or... Is it just for members? Thanks and best regards, Fernando Pelliccioni.

Hi, On Thu, Feb 9, 2012 at 19:30, Fernando Pelliccioni <fpelliccioni@gmail.com>wrote:
I never did this, but I've read on this mailing list I think that it is possible to have someone be your library/feature "chamion" IF he/she believes him/herself in the proposal and is already attending a commitee meeting. Someone from the commitee could confirm or infirm this. Joël Lamotte

Hi Joel, 2012/2/9 Klaim - Joël Lamotte <mjklaim@gmail.com>
I misspoke. I understand that the mailings are archived and can be accessed by anyone (? ). But I meant if possible (for a non-member) participate in discussions of the committee. I like the idea of feature "champion"... Regards, Fernando.

On Thu, Feb 9, 2012 at 22:32, Fernando Pelliccioni <fpelliccioni@gmail.com>wrote:
For people not registered officially, you can only access to the archives yes. But i was talking about the boost mailing list where I read this (or in another C++ forum maybe where there was someone that participates to the comitee). I remember Stroustrup or Sutter saying last week in the Going Native conferences that you first have to register to your country commitee or some kind of node of the commitee, and then see from there. Once done you have access to the official mailing list (if I'm correct) and can already try to discuss a proposal with the commitee. Then maybe someone will be willling to help promote the proposal once it's ready in an IRL comitee meeting. Again, I've never done any of this but that is my current understanding of the process. It might be totally wrong. Joël Lamotte

That's also one of the original charters of Boost. It is a framework for proposing, developing, and grooming libraries for C++ standard libraries. Many of the TR1 and many more of the libraries planned for TR2 were developed in Boost. I'm not entirely sure what PCL is yet. At this time, there are no clearly defined scope, goals, framework, process, or libraries. But there does seem to be some idea to provide -- for lack of any better term at this time -- a repository for corporate "donations" into the standardization process. The details are still being fleshed out. If you are interested in having libraries made part of the standard, Boost is still the most direct route. There are several people in the Boost community that could champion libraries. It might be great if there were more. Perhaps this would be a good time to start collecting information about what kinds of libraries we think the standard needs, who's going to write them, and how we're going to get them into the standard. What would make your jobs easier? Andrew

Hi, I am still a student and not a very experiment C++ developer, but I would like to give my two cents about what C++ need to be more attractive for the next generation of programmers. I am sory if it is naive, but it is how the current situation is seen by starting developpers. In my country's colleges and universities, C++ is in process to be replaced as a teaching and project developement language because there is no single place which could provide basic libraries for simple domains. It is a fact that there exists many out there, but teachers don't want to require there students (and computer lab technician) to install a plethora of libraries for the different exercises and projects they will have to do. And more, the vast majority of our computer labs are equip with Windows, but students frequently use Mac OS X and sometime Linux. Since C++ is a multiplatformes language, it would be nice for these libraries to be multiplatforme and boost have a great reputation for that. An other of the major facts is that it needs to be trivial to build trivial examples. One good example of a great needed is an XML parser library. We use it when studying web developement, network communication, report production and application configurations. The current fact is that it is too easy to just say that "it is standard in .Net so let's use C#". Boost is a great argument against that because it offers libraries for filesystem, networking, multithreading (now in C++11), regex (now in C++11), etc. We, as students and new C++ developers, would like to have access to a simple, but still efficient XML library. More, it would be a good addition for TR2 of, perhaps, TR3. Is there a technical reason explaining why ther it is not currently include in Boost? I've read a fiew times that the DOM implementation, which is currently what we are use for, was not integrating well with C++ and could be made simpler. That's the good time to search in this direction. I will finish by saying that the biggest advantage of the boost libraries is that they all come together and that is a major argument when trying to convinced someone or an organisation that libraries are available (event if not in the standard) and that it will not be an installation and maintenance nightmare. PS: My english is probably a little bit strange, I'm a french speaker and not very used to exprime myself in this language. Martin

Hi,
I understand, that you aare looking for a standard. If you were just looking for a solution, I'd propose to look into Qt. It has not only a lot of GUI stuff, but a pretty well designed foundation library as well, which also includes e.g. an XML parser. Yet it is not really well integrated with the standard library, let alone boost, though the Qt developers obviously are trying to improve on that. Maybe a good Idea could be to try and get a cooperation with the Qt developers going, that aims to remove Qts dependencies on language Extensions (Object Meta Information and their own signal-slot mechanism) and replace them with solutions that are completelly done with C++11, like e.g. boost signals2 library. When that is successfull, the result could be a great set of new boost libraries. Similarly an adoption of solutions like e.g. CPPCMS for web applications would also be a good Idea. Christof -- okunah gmbh Software nach Maß Werner-Haas-Str. 8 www.okunah.de 86153 Augsburg cd@okunah.de Registergericht Augsburg Geschäftsführer Augsburg HRB 21896 Christof Donat UStID: DE 248 815 055

Hi,
So I guess, you have asked them. That would be a reason to try and produce something new that can compete with Qt and fits better into the standard environment. Is there any interest in here to look into what we could learn from their design? Christof -- okunah gmbh Software nach Maß Werner-Haas-Str. 8 www.okunah.de 86153 Augsburg cd@okunah.de Registergericht Augsburg Geschäftsführer Augsburg HRB 21896 Christof Donat UStID: DE 248 815 055

Hi,
Well, they use Templates as well. AFIK the also support a pretty broad range of even old and embedded platforms, where not too modern and standard compliant compilers that claim to compile something similar to C++ are available. Anyway, that could also be something positive we could learn from their approach. I also think, there are positive things to learn from them - they do have some success and provide a quite poverfull library. Christof -- okunah gmbh Software nach Maß Werner-Haas-Str. 8 www.okunah.de 86153 Augsburg cd@okunah.de Registergericht Augsburg Geschäftsführer Augsburg HRB 21896 Christof Donat UStID: DE 248 815 055

On Fri, Feb 10, 2012 at 8:45 AM, Mathias Gaunard <mathias.gaunard@ens-lyon.org> wrote:
Actually, AFAIK, a lot of their base design dates early C++-98 times, when many compilers they supported did not yet support well some C++ features. So to be as portable as possible, they had to resolve to this kind of approach. And I think this is also a common misconception in the C++ world: many think still in terms of such old times and never updated to today. -- François Duranleau

On Fri, Feb 10, 2012 at 2:19 PM, Christof Donat <cd@okunah.de> wrote:
FWIW, I remember reading in the Qt doc (or site) a rational for not using pure C++ signal/slot designs. Can't find it again, but Mathias is right in that Qt view's its MOC-based system as a feature, and not a liability.
Is there any interest in here to look into what we could learn from their design?
Well, just add introspection and reflection to C++ (possibly on-demand instead of an all types and method for example), and the need for MOC pretty much disappears. MOC is not just used for signal/slot, but for introspectable properties, methods (and thus easy runtime integration to JavaScript for example), declaring safe enums, and other stuff still. Templates can "generate" code at compile time, but doing so is not easy nor makes builds fast (to say the least)... C++ would have to evolve a *lot* to replace MOC (or code-based code generators in general). With generalized code attributes added to C++11, I dream of a standard way to perform source code transformation in the compiler itself, as opposed to at a separate code-gen step, via a standardized AST and API to manipulate it per TU. Using such facilities, adding introspection and reflection becomes possible w/o having to be necessarily standardized, at least initially. I guess you can do that with Clang already, since it's OSS, but then you wouldn't be able to port that to other compilers... --DD

On Fri, Feb 10, 2012 at 15:14, Dominique Devienne <ddevienne@gmail.com>wrote:
[offtopic] Actually, there is a proposition to add "rich pointers" to the language (by proposed boost.network library, aka cppnetlib, author) that is meant to provide a way to get introspection to solve this problem. Some references : http://www.cplusplus-soup.com/2012/01/c-extensions-rich-pointers.html http://www.cplusplus-soup.com/2012/01/rich-pointers-frequently-asked.html The proposal : http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2012/n3340.pdf [/offtopic]

----- Original Message -----
This is very true. In fact, at one place where I worked I wrote a Q_PROPERTY like macro that generated meta data classes that enabled reflection. It worked like this: class SomeClass { PROPERTIES ( property((int) id, get get_id), property((string) name, get get_name, set set_name) ) ... }; It is slighty different than the Q_PROPERTY, just so it can be parseable by the peroprocessor. And everything needed to be defined together in one master macro, to make it easier to index the meta-data classes. It would've been nice to write it like this: class SomeClass { PROPERTY((int) id, get get_id) PROPERTY((string) name, get get_name, set set_name) ... }; But I could never finde a good way to do that. -paul

----- Original Message -----
How would you use a switch? My design works by creating a metadata class, which would look something like this: class SomeClass { public: const int metadata_count = 2; //Partial-specialize this class for each property template<class Self, int N> struct metadata {}; template<class Self> struct metadata<Self, 0> { Self& self; metadata(Self& self) : self(self) {} int get() const { ... } void set(int x) { ... } const char * name() { return "id"; } }; template<class Self> struct metadata<Self, 1> { Self& self; metadata(Self& self) : self(self) {} string get() const { ... } void set(string x) { ... } const char * name() { return "name"; } }; ... }; Then I use the for_each from the MPL library to iterator over metadata classes. Then the user can access the properties using the visitor pattern like this: struct property_visitor { void operator(T x) { cout << x.name() << "," << x.get(); } }; SomeClass x; visit_each(x, property_visitor()); Now, the metadata_count is known because its all in one macro. To seperate it to each macro would require using the line number or something like that as the index. Which would require me to iterate over all integers to find valid metadata. How would you approach it using a switch and hard-limit? Sounds interesting. Perhaps that switch could be collapsed into compile-time "switch" of some sort. -paul

On 02/11/2012 02:39 AM, paul Fultz wrote:
All right so you still need the switch regardless in this case if you want to implement a property(i) function. i.e. switch(i) { case 0: return metadata<Self, 0>(self).get(); case 1: return metadata>self, 1>(self).get(); ... }
You could use __COUNTER__ to deal with this, but that's not very portable, and might also prevent other uses of __COUNTER__ between properties. There are template-based techniques to have counters as well, but they're quite tricky and tend to be fragile with subpar compilers.

Yes, the switch would still be needed to do the property(i), but I think the visitor pattern is the better way to go(especially once we have polymorphic lambdas in C++).
There are template-based techniques to have counters as well, but they're quite tricky and tend to be fragile with subpar compilers.
I'm curios as to what template techniques there are to do this. Please elaborate.

On 02/11/2012 05:53 PM, paul Fultz wrote:
Well, you end up doing compile-time reflection. Sure, it's better in a way since you can properly support any type for any property without going to the string common denominator, but Qt needs the ability to iterate over the properties of an object without knowing what the type of that object is.
There are several, I have yet to find one that is really perfect. The best there is is probably using overloading. int_<0> counter(depth_<0>); where depth_ is template<int N> struct depth_ : depth_<N-1> {}; template<> struct depth_<0> {}; to read #define READ identity<decltype(counter(depth_<MAX>()))>::type::value and to increment, int_<READ+1> counter(depth_<READ+1>); The problems (apart from the fact that it depends on a decltype- or typeof-like feature in the compiler and that it is all in all quite hacky) are the interactions with ADL in certain template contexts, especially with compilers that don't do two-phase lookup correctly (e.g. MSVC). I don't really see that kind of thing being democratised in any case. You should find a way to avoid relying on compile-time counters.

Hi,
The original issue was, that there is not a single place to look at and get all the libraries you need. Boost could be a good choice for such a place, but it still lacks a fiew things that are generally used in many applications. I came up with Qt, because Qt solves a lot of those issues, lacking many of those that boost solves. Since Qt does not really cooperate well with STL and boost, I came up with the idea if it would be possible to either help the Qt people move more towards the standard, or take lessons from them to implement those features in a more standard way. I am not blindly advocating Qt here, though I actually do like it in many cases. It was just what came to my mind reading the original question. Actually I first was tempted to simply suggest to use Qt, but that would not have helped with the real issue. Christof -- okunah gmbh Software nach Maß Werner-Haas-Str. 8 www.okunah.de 86153 Augsburg cd@okunah.de Registergericht Augsburg Geschäftsführer Augsburg HRB 21896 Christof Donat UStID: DE 248 815 055

On 02/10/2012 06:05 AM, Martin Desharnais wrote:
Most French universities already do C + Java and no C++. It's the same worldwide, some don't even do C anymore. That's to be expected, C is for learning and low-level programming, Java is for pulling together random software projects with minimal effort. I don't think more accessible C++ libraries would change that.
We, as students and new C++ developers, would like to have access to a simple, but still efficient XML library.
libxml2. It has a fairly good C++ wrapper, too.
DOM is an in-memory representation designed for Java and Java-like languages. In C++, there could arguably be better, but there is no particular problem providing that particular interface.
You could also install whatever you need locally. None of the computers I work with have Boost installed, I use my own version in my home directory (which allows me to use the version I want, including trunk).
participants (10)
-
Andrew Sutton
-
Christof Donat
-
Dominique Devienne
-
Fernando Pelliccioni
-
Francois Duranleau
-
Klaim - Joël Lamotte
-
Martin Desharnais
-
Mathias Gaunard
-
Olaf van der Spek
-
paul Fultz