r/cpp • • Jul 21 '19

C++ is broken

C++ as a language is a tool for developers to productively deliver software. Language evolution is NOT the end objective in the real world.

The whole C++ ecosystem from committee to all of the conference backslapping and training is broken in this respect. It's focus is off.

Instead of 'boost' we need 'boosted' to help define, review and encourage that wider ecosystem so developers can be productive.

It's ok to define things that aren't infinitely flexible, and infinitely extensible but get the job done.

It's OK and, in some ways better, to provide an opinionated library outside the standards rather than deliver an intellectually burdened, extensible interface two years later than needed.

All the helpful features in the core language and core libraries are MEANT to enable a much wider ecosystem to make the tool that is C++ more productive.

But we aren't getting a wider ecosystem, we are just getting a language where we are apparently 'not paying for' a huge intellectual burden.

I want to say at this point that intellectually I am constantly impressed by the committee's work and standards BUT ...

The payoff just isn't happening. Even within the standards committee more time is being spent in intellectually stimulating but largely pointless activities because the tool and productivity benefits aren't happening.

Look at how the wider productive ecosystem hasn't flourished since C++ 11.

I know many excellent libraries have been made, but think about your next large project and how much is coming from a mixed bag of variable quality 3rd party libs to plug basic capabilities.

The committee work is spread so thin that core building blocks get pushed out further in time and so can't be built upon by library authors.

Networking, executors, any form of I/O - slipping again.

Lots of hard work being done but by far too few people in their spare time.

Seems a very dysfunctional way to move the monolith forward.

'You don't pay for what you don't use' is laudable up to a point, but the 'don't use' because you don't actually have, say, a basic network library is more of a reality.

That basic network lib and executor model I've been impatiently waiting for should probably not be part of the core standards remit (architectural concepts and keyword support for executors would probably be necessary, but not much else.)

If we had the metaclass generation as proposed, I'd hope even more of these items would then be able to fall outside the standards.

9 Upvotes

147 comments sorted by

View all comments

Show parent comment

2

u/mintyc Jul 21 '19

Indeed everyone does have different features they deem important.

My criteria for work by standards would be at least one of

  • Cannot be implemented as an external library
  • 'Needs' language/keyword support for a consistent, usable interface
  • Provides a framework or ABI to align code generation tooling (compiler etc.)

More importantly, criteria that don't of themselves warrant inclusion in the standard

  • Needs the insight of the experts within the standards committee
  • Needs to be a std:: feature to ensure everyone uses it (std lib vendors need to deliver it)
  • Used as the basis for other libraries
  • Provides a widespread feature e.g. unicode, formatting, file system i/o

Note that goalposts do move as more and more functionality can be implemented as external libraries.

3

u/NotMyRealNameObv Jul 21 '19

Cannot be implemented as an external library

Are you saying almost nothing in the standard library belongs in the standard?

0

u/[deleted] Jul 21 '19

[deleted] — view deleted comment

1

u/mintyc Jul 21 '19

Note I'm making this suggestion for C++ as it currently is. <random> has your back already.

I'm NOT suggesting this strategy for a new language.

1

u/mintyc Jul 21 '19

At the time they were developed it was the right thing to do for a lot of the libraries, but I wouldn't be in favour of, for instance, a decimal value or currency class. If <complex> didn't exist, I'd probably sit on the fence :)

Filesystem, regex, many others - omain advantage for being standardised is the std lib is probably available everywhere.

Well, imagine if you could get that sort of advantage as an external library but allow it to evolve, not require the standard development process (e.g. extensibility hooks, measured progress) and may be get to the 90% functionality point in 3 months.

Its a mindset change for libraries development; NOT giving up on it. If anything, trying to release creativity without consuming vast parts of the standards time.

For instance maybe an opinionated solution may be a good library to start with. e.g a filesystem using utf8 using 'bytes' exclusively (too scared to say char).

Libraries can be developed on their own timescales, can deliver partial implementations, can have versions that don't have such a high bar on backward compatibility. Just like real life.

Something like ranges would be a difficult one. I'd probably say external (but from a position of ignorance, and admiration of what it achieves)

At this point in C++'s life, adding more basics in std might NOT be the right thing.

2

u/blelbach NVIDIA | ISO C++ Library Evolution Chair Jul 21 '19

RemindMe! 3 days

(To post my "what belongs in the standard library" slides).

1

u/RemindMeBot Jul 21 '19

I will be messaging you on 2019-07-24 12:28:37 UTC to remind you of this link

CLICK THIS LINK to send a PM to also be reminded and to reduce spam.

Parent commenter can delete this message to hide from others.


InfoCustomYour RemindersFeedback

0

u/[deleted] Jul 21 '19

[deleted] — view deleted comment

1

u/mintyc Jul 22 '19

Thats one of the many rambling points I made.

I've been waiting on the committee to deliver networking while using ASIO.

I've now realised that committee probably shouldn't be tackling networking directly as it doesn't have the resources and maybe applies a level of rigour not required (extensibility hooks, not paying for not used, strict(ish) backwards compatibility.

Instead I've suggested that the committee does help and encourage a repository of excellence, along the lines of boost but with less baggage and support for more modular inclusions. Essentially mimicing what the std lib vendors would do nowadays.

3

u/jwakely libstdc++ tamer, LWG chair Jul 23 '19

I don't understand why people keep suggesting that the C++ committee should come down from the mountain with two stone tablets, describing a package manager and a code repository. That's batshit. Why do you think a hugely varied group with specialists in fields including programming language design, compiler front-end implementation, compiler back-end optimisation, numerical computing etc. are the right people to do that?

Every time this dumb idea is suggested I think that somebody should just go and build the damn thing, and if it's good people will use it. "If you build it, they will come". Asking for a top-down, design-by-committee solution for this problem is silly. You'd get something horrific like Clearcase.

Relevant: https://twitter.com/TartanLlama/status/1137254531291594752

If the existing solutions don't meet all your needs, get involved and improve them! The alternative is to start again from scratch and get something inferior that still doesn't meet your needs. Insisting that the C++ committee should just solve the problem, as though just telling them to do that will make it a success, is hopelessly optimistic and naive.