Thread: C++0x Concepts fall

  1. #1
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446

    C++0x Concepts fall

    I haven't been following Kevin's column for some time. So when I got Artima's newsletter today, it came as a shock to me.

    Buried in the list of new articles, in 4th place -- after such otiose articles as a discussion on Ruby's arguable responsible programming characteristics or the hundredth AIR advocate interview this week -- is the actual news of the year; Concepts have been dropped from C++0x. Artima's here and Kevin's here.

    Now, I'll take the stance no one seems to want and ask what the hell have these folks been doing all these years. The last paper on the matter was published in January 2006. Since then, there has been no new developments. When last year, around August if memory serves me right, Stroustrup presented the new features to be discussed on this meeting exactly, he mentioned concepts and devoted quite a few paragraphs to it. Just didn't he know he's work was incomplete? Why not just say it then, instead of waiting until last month (pdf link)? I'll let go a little more air and say that since we hardly heard of Dos Reis since 2005 and Stroustrup was busy writting his new book (as if there weren't enough C++ for Beginners material) it's no wonder Concepts never really were. Or should I say, it was a nice concept?
    Last edited by Mario F.; 07-23-2009 at 08:04 AM. Reason: had a wrong link
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Location
    California
    Posts
    3,268
    Having a standards committee is a double edged sword. While it is nice to have a diverse group of people studying every problem from every angle to discern any problems, it comes at a cost. That cost is that moving forward becomes difficult due to the amount of people that must be satisfied with every change.

    These costs and benefits can be exemplified in the differences between OpenGL and DirectX. OpenGL is managed by a standards committee whereas DirectX can move at whatever speed Microsoft deems necessary. Guess which one of these is lagging behind the bleeding edge graphics technologies?

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by bithub View Post
    Guess which one of these is lagging behind the bleeding edge graphics technologies?
    DirectX?
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Geez, the committee is run by a number of blockheads. They argued for the feature for so many years and then dropped it? Morons!
    Concepts was a really nice feature that I would have liked.
    And what is the article spouting about otherwise? Namespaces bloated?
    Why can't the committee just do one step at a time? Implement a small version of concepts, see how it goes and then evolve it.

    And I'll take the above comment as sarcasm.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    Concepts are a great idea of course, but I really think that the way they were planning to implement them was too complicated. Personally, I would have just incorporated ordinary templates into the scheme. Whenever the compiler encountered a concept it could simply attempt to compile the template associated with it, and if it failed then there is no match. For example:

    Code:
    template < typename T >
    struct has_bar_function
    {
    	static void constraint( T& t )
    	{
    		t.bar( );	
    	}
    };
    
    template < typename T >
    requires has_bar_function< T > 
    void foo( T& t )
    {	
    	t.bar( );
    }
    
    template < typename T >
    void foo( T& t )
    {	
    	// do something else with 't'
    }
    
    struct baz
    {
    	void bar( void )
    	{	}
    }; 
    
    struct qux
    {	};
    
    int main( void )
    {
    	baz b;
    	qux q;
    	foo( b ); // meets has_bar_function< baz > requirement
    	foo( q ); // doesn't - use some other foo function	
    }
    That way, the only change you've made to the language is to add the 'requires' keyword, plus you could use *any* template (std::vector, for instance!) to define the requirement.
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

  6. #6
    C++11 User Tux0r's Avatar
    Join Date
    Nov 2008
    Location
    Sweden
    Posts
    135
    Quote Originally Posted by MK27 View Post
    DirectX?
    Direct3D fails irl.

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    Elysia, I really don't think you are in any position to call the committee names. How closely have you followed the process? What do you know about the history of the proposal that lets you be a judge in the matter?

    It's not true that there were no recent developments. For the last two years, the committee has tweaked, revised, and integrated concepts with the rest of the language. Integration, especially with the library, was a very complex task, and uncovered many weaknesses, both of concepts themselves and of other language features, such as rvalue references.
    Kicking concepts out of C++0x was the admission that they underestimated the complexity of the task. Concepts are too complex - they were effectively designed by committee, and lacked a usable real-world implementation. This lack meant that too many practical issues were not immediately obvious, which explains why it took the committee so long to remove them - it wasn't until very recently that they realized just how much more work would have to go into concepts to make them work.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by CornedBee View Post
    This lack meant that too many practical issues were not immediately obvious, which explains why it took the committee so long to remove them - it wasn't until very recently that they realized just how much more work would have to go into concepts to make them work.
    This makes sense, naturally. But I can't find anywhere a description of what these issues where. I expect that information to be revealed soon, since I feel an explanation is required. Certainly some of the issues I will not understand. But I'd feel a lot better knowing it's not just politics or trifles.

    I do not object to the Committee decision. Let that be clear. If it's not ready, it's not ready. Neither I am in favor of partial solutions that "grow in time" because there would be a serious risk of hitting a dead end and then the language would be left weakened with a feature that couldn't be removed neither it could be finished... only patched. Hey, I support the Committee decison!

    But I do question the work that was done on this issue, CornedBee. Can't avoid it. The Joe Coder thread is three months old. It starts with a simple question that should have been answered 3 or 4 years ago. But during all that time, concepts where introduced into all the drafts and contrary to what you say, I can't see anywhere where concepts differed significantly since the 2006 paper. I'm left with the impression there has been hardly any work done on them to address the concerns that were raised during all these years.

    They are different now. Oh yes, they are. One month before the meeting Stroustrup finally publishes a new concept on Concepts. Too late, don't you say? And all because someone asked "Will an average programmer want to use concepts?". Oh, please!

    edit: edited the original post. Only realized now I was linking Artima's post to another topic altogether.

    edit 2: Concerning the first paragraph of this post, here's the Stroustrup's detailed explanation, published yesterday. I cannot stop feeling that this wasn't a well planned project. Within my limited understanding, all this seems like somewhere along the development of this proposal, the authors lost focus of its objectives. Not only that, but at large ignored the debate until too late. Until 3 months before Frankfurt.
    Last edited by Mario F.; 07-23-2009 at 08:26 AM.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  9. #9
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by CornedBee View Post
    Elysia, I really don't think you are in any position to call the committee names. How closely have you followed the process? What do you know about the history of the proposal that lets you be a judge in the matter?
    Maybe not. It's an opinion because from the little I have "seen" which is mostly what has been presented in the thread seems to tell the tale that they simply dropped it because it was too complex, or lacking or just because there was no real world example of it.

    Now, if it is true that they simply didn't have time to make it work right, then I can understand, and then I would agree that it would need to be cut out and delayed. I will not forgive them if concepts do no see light of day. But I will forgive them if the concepts appear in a later standard.
    Frankly, though, I'm disappointed. Too much discussion and too little real world experimentation with the feature is what it looks to me.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  10. #10
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by Elysia View Post
    Frankly, though, I'm disappointed. Too much discussion and too little real world experimentation with the feature is what it looks to me.
    Indeed. I find it astonishing that 3 months before Frankfurt the head of the library team is still discussing whether Concepts are adequate for the average Joe. But I find it even more incredible the fact that such core concepts as implicit mapping are still being discussed. Is this a joke? What have they been doing? I don't pretend I know the inner workings of the C++ Standards Committee, but these type of things should have been agreed upon at most by the end of 2008. The last meeting of any standards body before implementation (which is what this meeting was) should be a near ad-hoc meeting meant to establish deadlines and gather final impressions and minor adjustments.

    The funny bit is that I don't take sides on this matter. The only side I take is that of a generic agreement to the decision to not implement Concepts, given the situation. But there should be no patting on the back. This is a big failure and instead of painting it in pretty colors, or pointing fingers left right and center, I feel instead they should consider this everyone's failure. C++0x is a dissapointment in the way it was conducted.

    Meanwhile, C++0x was to be taken literally. It will be either C++0xA, or maybe C++0xB.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  11. #11
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    Quote Originally Posted by Mario F.
    But I'd feel a lot better knowing it's not just politics
    Sadly, I have heard both Ahmadinejad and Medvedev are against strong typing and everything that goes with it, so you guys may just have to bare with for a while.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  12. #12
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    "Integration, especially with the library, was a very complex task, and uncovered many weaknesses, both of concepts themselves and of other language features, such as rvalue references."

    O_o

    Please don't tell me "r-value references" were dropped too!?

    Soma

  13. #13
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    Quote Originally Posted by phantomotap View Post
    Please don't tell me "r-value references" were dropped too!?
    No. Move semantics aren't dependent on Concepts. rvalue references stay. As do most of the other features in 2008 draft. Do not forget that this draft didn't include a Concepts library and many of the proposals that "depended" on it where so only for a matter of consistency, probably. Prior to the 2008 Draft they didn't use Concepts and were still perfectly functional proposals.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  14. #14

    Join Date
    May 2005
    Posts
    1,042
    programming is stupid.
    I'm not immature, I'm refined in the opposite direction.

  15. #15
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    These costs and benefits can be exemplified in the differences between OpenGL and DirectX. OpenGL is managed by a standards committee whereas DirectX can move at whatever speed Microsoft deems necessary. Guess which one of these is lagging behind the bleeding edge graphics technologies?
    I wouldn't say Direct3D is ahead of nor behind OpenGL. They are both at about the same place. But at MS they have an entire dev team devoted to Direct3D so it is really not fair to compare the two. Besides Direct3D is just an interface to the HAL which means hardware manuf. come out with new ideas, hardware manuf. implement them on the card, D3D gurus write the interfaces in D3D, and driver gurus implement the interfaces. There a whole lot more people involved than just Microsoft when it comes to the advances in Direct3D.

    The source of the advances is buried deep within the walls of NVidia and ATI.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 5
    Last Post: 08-31-2004, 06:41 PM
  2. Programming concepts
    By lyx in forum C++ Programming
    Replies: 2
    Last Post: 12-03-2003, 12:37 AM
  3. Independent & Effeciency :: Programming Concepts
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 06-08-2002, 05:08 AM
  4. Basic 2d Programming Concepts
    By JoshG in forum Game Programming
    Replies: 4
    Last Post: 05-17-2002, 05:54 AM
  5. Microsoft Fall?
    By Sekti in forum A Brief History of Cprogramming.com
    Replies: 5
    Last Post: 02-25-2002, 04:21 PM