19 ms·
Why Concepts didn’t make C++17
- hellofunk 11y agoIt's such a tease to see a headline I'm really interested in, only to wait for the excitement to die down so the guy's web server is accessible again! That's okay, I can wait -- concepts are something I really want to learn more about and understand how they work, what they do, and every new article helps.
- taspeotis 11y agohttp://webcache.googleusercontent.com/search?q=cache:http://honermann.net/blog/2016/03/06/why-concepts-didnt-make-cxx17/ http://webcache.googleusercontent.com/search?q=cache:http://...
- blackhole 11y agoI desperately, desperately want this feature, but I am glad that the committee is determined to implement it correctly. C++ already has a convoluted, complex syntax, it doesn't need to be made any more complicated.
- thechao 11y agoA large portion of my dissertation revolved around the original C++0x concepts proposal. There are some amazing things you can do with concepts; I think the most important part of '0x concepts were 'concept_map's. However, I don't think they're anywhere near as important as truly lightweight coroutines, modules, etc. Mostly, they added a great deal of complexity to both the compiler implementation and, more importantly, day-to-day coding. One thing I don't see discussed is that if you don't want concepts without ugly & nonintuitive "holes" (backdoors), they tend to leak everywhere---especially into code you'd never expect to find them in.
- KKKKkkkk1 11y agoSounds like your dissertation would be interesting to a lot of people on HN. Mind sharing a link?
- thechao 11y agohttp://oaktrust.library.tamu.edu/bitstream/handle/1969.1/ETD-TAMU-2010-05-7823/SMITH-DISSERTATION.pdf?sequence=2&isAllowed=y As always, if something is correct, it's probably due to the good auspices of my advisor; if something's wrong, I've lost all sense of shame, long since.
- vmorgulis 11y agoI've seen the name of Gabriel Dos Reis in the committee member list. I wonder if he gave up "the Pivot" (and Stroustrup too)...
- hacker_9 11y agoGoogle Cached Page here [1] as the link is Down. The summary: the committee failed to achieve consensus that Concepts, as specified in the TS, has attained sufficient implementation and usage experience to be confident in the current design. Basically, the committee did not say “no” to concepts, it said “not yet.” [1] http://webcache.googleusercontent.com/search?q=cache:SurLIowej1oJ:honermann.net/blog/%3Fp%3D3+&cd=3&hl=en&ct=clnk&gl=uk http://webcache.googleusercontent.com/search?q=cache:SurLIow...
- pjmlp 11y agoEven though I hardly use C++ nowadays, concepts and modules were two features I was looking forward to see in C++17, as a language geek. However if it wasn't for my goal to write portable native code across mobile OSes or the occasional weekend dive into LLVM, I would hardly touch C++ nowadays. Waiting until C++20 for them, will mean 4 more years for alternatives to slowly erode C++'s usage where its features aren't really that critical for fulfilling the customer's use case. On the other hand, people are still writing new Fortran code everyday, so maybe those 4 years won't make a difference to those highly invested into C++.
- unfamiliar 11y agoEven Fortran has modules though hahah.
- dsharlet 11y agoFortran doesn't have templates. Frankly, I doubt modules will ever exist for C++, because they seem fundamentally incompatible with templates. To me, people that complain about modules being delayed look like people complaining that they don't have jet packs and teleporters.
- duaneb 11y ago> because they seem fundamentally incompatible with templates How so? Their use cases seem orthogonal.
- pjmlp 11y agoYet any others languages managed to have it, even older than C++ with parametric polymorphism. Also modules are already on VS 2015 Update 1, just not as final design.
- unfamiliar 11y agoWhat about templates make them incompatible with modules? If they can be encoded in text, they can be encoded in some abstract binary format. People just have to agree on what that is. From what I understand it is the preprocessor macros that make this really awkward. Personally I would like to see C++ abandon those in favor of a "real" macro system. If there was some kind of parametric polymorphism in Fortran I would die happy.
- crb002 11y agoI want C++ to have a built in SMT solver expressive enough that it can do concepts and a whole lot more. Maybe a new keyword constrain?
- bjz_ 11y agoSurely you could just write the SMT solver in templates, right? ;)
- makecheck 11y agoGood. C++ still badly needs to go through a phase of tuning, deprecation and removal before adding much more. As I have said before, there have been shockingly poor design decisions in some of the oldest and most fundamental standard libraries. Little to no work has been done to introduce replacement APIs (or even replacement classes) that would allow the deprecation of stupid features to begin.
- pjc50 11y agoWhat targets did you have in mind? Boost seem to do a good job of "standard library 2.0", although perhaps a bit too keen on the templates. Killing anything in any C++ that's actually used is going to be extremely hard. Systems stick around forever. Yesterday I had to write some COM/OLE code because it was the only way to do something.
- signa11 11y ago> As I have said before, there have been shockingly poor design decisions in some of the oldest and most fundamental standard libraries. if you don't mind, may you please elucidate a few here ? or if you already have a dedicated post may you point to that ? thank you !
- clishem 11y agohttp://i.imgur.com/mgd4hDk.jpg http://i.imgur.com/mgd4hDk.jpg
- vmorgulis 11y agoFunny. https://github.com/gcc-mirror/gcc/blob/bd3f0a53c07086e978ea4ec00e10a20e4a969c40/libstdc%2B%2B-v3/include/bits/stl_tempbuf.h#L92 https://github.com/gcc-mirror/gcc/blob/bd3f0a53c07086e978ea4... I'm not sure of the behaviour but there is still a loop...
- goalieca 11y agoYeah. Iostreams doesn't work with strings and is not const correct. Also a horrible idea to use oop IMHO. Somehow POSIX is a lot simpler to use with read/write and void
- _yosefk 11y ago"Concepts have been widely expected to produce better error messages than are currently produced when template instantiation fails. ... Unfortunately, it turns out not to be so simple and use of concepts sometimes results in worse error messages. Constraint failures frequently manifest as overload resolution failures resulting in a potentially long list of candidates, each with its own list of reasons for rejection. Identifying the candidate that was intended for a given use and then figuring out why the constraint failure occurred, can be a worse experience than navigating a template instantiation stack." Perhaps someone indeed has been "widely expecting" a huge new source of complexity in C++'s already very complex static binding rules to help produce better error messages. I personally have never met that someone.
- rat87 11y agoI'm not that into c++ but I thought better error messages was one of the main if not the main point of concepts. Basically the problem with templates is that there is no check for whether a thing can be satisfy a function/operation till it's fully expanded and it's hard to figure out where the "error" occurred during the template expansion. I thought concepts were meant to be like type classes (and type class limits to generics) in other languages so that the template writer could say that a template parameter has to implement x,y,and z and if the type passed in doesn't put the error at that expansion. An optional constraint on a feature(templates) otherwise too powerful for good error messages.
- _yosefk 11y agoWell, they didn't stop at concepts as contracts to be checked, instead they let you have a different oveload called depending on what concepts your argument types implement. Hence the problem with having to sift through potential overloads and reasons for rejection.
- vmorgulis 11y agoNew items for the FQA :-)
- gpderetta 11y agoAt this point, I don't really care any more about having concepts for better error messages. I can usually figure out what the compiler is telling me after skimming through the first 7 pages of template errors ;). The reason I really want some sort of concept support is because the jumps you have to go through to define a generic function that, for example, takes only a range of some specific Ts are getting ridiculous. Especially if you have multiple overloads. Also, some of the syntactic sugar of the proposal is nice (implicit templates, concept names instead of auto).
- rilut 11y agoIs there a Rust equivalent for Concepts?
- steveklabnik 11y agoTrait bounds, in my understanding.
- deleted 11y ago[deleted]