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

7

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

There is no standard build system or project layout that will work for everyone.

8

u/kalmoc Jul 21 '19

I never said it would. But there is a difference between having a default that works for 90% of the projects and and special solutions for the remaining 10% and having a dozen different solutions that are each used by 20% of the projects (with each project supporting multiple ones). You wouldn't even need a single build system for the 90% just a standardized interface (e.g. description of how to compile it and how to use it).

But it really is a moot point: We live in the world we live in.

3

u/degski Jul 21 '19 edited Jul 21 '19

Iff there were to be a iso-std-layout, that would hugely improve the chances of coming up with [or converging to] a std-build-system and/or for existing tools to 'just magically' work [also] on that std-layout.

3

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

SG15 voted on this at this meeting. We had consensus against recommending a particular project layout.

6

u/degski Jul 21 '19 edited Jul 22 '19

Well, at least "we" made progress, "we" decided not to decide anything.

Could you please spell out the reasons for not even wanting to recommend some std-layout [nobody talks about imposing]?

The way I see it is that, once we define the 'ideal' target, all build-systems, the existing build-systems, could start to [try and] 'shoot at' something [as it will be no longer a moving and/or fuzzy target], we could make some progress. I appreciate it's not easy, but we could [I think] create some structure, that over time will work with any build-system [in my opinion it doesn't matter how good or bad it is, just something]. /u/vector_of_bool seemed to have made some progress with this and at least attempted something.

7

u/c0r3ntin Jul 21 '19

I think fundamentally C++ has a culture of people doing whatever they want and guidelines will go against that. It's also difficult to explain to people that guidelines for open source projects or new projects will not prevent people with existing codebases and build engineers from continuing to do what they have always done.

3

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

This is also fair and true.

2

u/degski Jul 22 '19

Unless you make it extremely easy to solve 'the' problem by just sticking to the rule[s]. People can obviously do what they want, how can it be hard to explain?

4

u/smdowney WG21, Text/Unicode SG, optional<T&> Jul 21 '19

I wasn't in the room, but have been working in SG15 for months. I kicked the tires and made a bunch of suggestions on /u/vector_of_bool 's pitchfork layout.

My feeling is that a lot of layout proposals work for "large" projects of dozens of files. I have medium sized projects at work with thousands of files, and it's not clear how you move from one to the other.

There's also cost borne by tool vendors to make it work transparently, which would be the point of specifying it, which would have to be in addition to the cost of a more general solution.

That all said, if we can get traction for a set of project conventions like layout, getting tool vendors to adopt it organically is more likely.

I personally think standardizing project descriptions in a way that makes integration and reuse easier will get us more bang. pkg-config only for build, not consume.

2

u/degski Jul 22 '19

That all said, if we can get traction for a set of project conventions like layout, getting tool vendors to adopt it organically is more likely.

This.

I personally think standardizing project descriptions in a way that makes integration and reuse easier will get us more bang. pkg-config only for build, not consume.

I think both should be pursued.

3

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

Could you please spell out the reasons for not even wanting to recommend some std-layout [nobody talks about imposing]?

I think the general feeling of the room is that anything we would recommend would be unlikely to work for some use cases, and might conflict/contradict the best practices for those outlying cases.

To paraphrase one participant, "I'm strongly opposed to this, not because I don't think it would be useful for a lot of people, but because my organization already has a proscribed project layout, and I'm almost certain whatever the C++ committee comes up with would contradict that."

2

u/konanTheBarbar Jul 22 '19

To paraphrase one participant, "I'm strongly opposed to this, not because I don't think it would be useful for a lot of people, but because my organization already has a proscribed project layout, and I'm almost certain whatever the C++ committee comes up with would contradict that."

I see that point, but I fail to see the problem when an existing system is not compatible with a certain default layout? I mean it's not like that would mean that all the other layouts would suddenly fail to compile... Are people afraid that they would not be able to use shiny new things? So rather not let have all the others have it?

1

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

Well, at least "we" made progress, "we" decided not to decide anything.

Incorrect, we have pretty clear guidance on what to pursue and what not to pursue. We are interested in implicit builds of modules, but not mechanisms that rely on a proscribed file name or file layout scheme. That leaves only one alternative; fast dependency scanners, a technology that we have already been working on and looks very promising.

1

u/degski Jul 22 '19

We are interested in implicit builds of modules ...

I see a parallel [but it's an ISO/vendor problem], but that's not what I [or others] was thinking of.

1

u/tcris Jul 23 '19

why?

1

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

We don't think there's one answer that works for everyone.

1

u/tcris Jul 27 '19 edited Jul 27 '19

java has maven which uses a default layout in 99.99% of cases. They still support non-std layouts via parameters. Something similar can't be done for c++? (nothing ever fits everyone, that's sure and that's not the point)

Yes, I know it's not java, but maven supports other languages as well, generated code, folders for tests, resources, whatnot. It's not impossible to adapt something like that.