r/programming • • 19d ago

Profiles for Simplicity and Guarantees - Bjarne Stroustrup

https://youtube.com/watch?v=41USGJaGsAo&si=H-NTNZjGn27koBxM
26 Upvotes

28 comments sorted by

9

u/thegreatunclean 18d ago

Wasn't one of the main reasons Profiles was pushed forward over other approaches to increased safety because they didn't require extensive annotations?

12

u/FrogNoPants 18d ago

Ya the hypocrisy doesn't seem to bother them.. and it looks like Profiles would require alot of annotations.

I'm also not seeing anything resembling simplicity in profiles.

1

u/huangsara-43824 15d ago

A concrete comparison would help: which annotations are required, and what guarantee does each buy? Without that, 'simpler' is hard to assess.

5

u/Dragdu 17d ago

Profiles were pushed because Bjarne likes them and doesn't like the (systematic, actually proven to work) approaches that someone else made them (because he didn't make them).

No more, no less.

36

u/standing_artisan 19d ago

Simplicity coming from the guy that made the bloatiest language ever.

54

u/aaulia 19d ago

I'd give him some slack. He doesn't "own" the language, per se. C++ have a standardization body CMIIW, so getting something through need approval from multiple parties.

16

u/YikesTheCat 19d ago edited 19d ago

Only since C++11. It already had a (IMHO earned) reputation for being quite complex before that. I do agree it's gotten even worse since then and it's certainly not 100% Bjarne's fault, but also not 0%.

C++ compilers of the 90s and early 2000s really sucked, in no small part due to the language complexity. You could find examples of contrived but valid C++ that simply would not compile, often using a lot of CPU and memory in the process of not compiling (compilers are much better today).

3

u/-TesseracT-41 18d ago

C++ has been standardized since 98

0

u/YikesTheCat 18d ago

Only since C++11 have they been adding many features. Prior to that it was primarily about documenting and standardizing the existing status quo.

1

u/-TesseracT-41 17d ago

Well, it is not like they were doing nothing between 98 and 11. It just took a long time to finish the new standard, partly because they did not have the three year release cadence back then. And 11 was a huge change

1

u/steveklabnik1 18d ago

This is true, but also, the latest standardization failed to pass, and some folks have argued that it's because Bjarne's opinion was given more weight https://www.reddit.com/r/cpp/comments/1xr8y5c/herb_sutter_when_a_languages_creator_and_its/

20

u/TeraFlint 19d ago

I mean, that makes it especially important to talk about simplicity.

Bjarne himself said multiple times that "in C++ there's a much simpler and cleaner language struggling to get out". He's been trying to chase that for several years, now. But finding these solutions is difficult, especially in a language with so much history and needed backwards compatibility. Bjarne has been using his talks to put out some really good ideas to combat this, but it takes time and effort.

3

u/max123246 18d ago

Yeah it's called Rust

1

u/randomguy4q5b3ty 18d ago

Honestly, instead of fighting the monster he helped setting up, he should have just lead C++ 2.0, own the language, and actually implement his ideas instead of just advocating them in dozens of inconsequential talks and papers.

15

u/pp-collision 19d ago

C++ would be a very different language if Bjarne was benevolent dictator for life, but design by committee means that all the features that are uncontroversial gets added to the standard, and since there's infinite backwards compatibility and people that design C++ features for resume padding, we have a governance model that optimizes for language bloat.

8

u/nukethebees 19d ago

people that design C++ features for resume padding

Could you give some examples?

14

u/pp-collision 19d ago

P1102R2, P1048R1, P2324R2, P3142R0, P2360R0.

To name a few recent ones. It's often academics that propose some little syntax sugar or something, which further complicates language/compiler development (bloat).

Now you could make the case for each one, as they do, but it's proposal after proposal and nobody really cares. Who even use this sugar https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p1102r2.html, I don't and the only reason nobody voted it down is because of the line "This change will not break existing code.".

It's politics obviously and you could argue that it's just my opinion blabla, and yes, it's my opinion that these proposals really only achieve bloat and slowing down compiler developers.

16

u/erichkeane 19d ago

I think you're confused about P1102? That paper was to fix an issue that was filed initially by Herb Sutter which pointed out an inconsistency: auto lambda = []{}; was permitted auto lambda2 = [] mutable {}; was NOT permitted.

This was a strange inconsistency in the grammar. At the time P1102 was written, EWG had already discussed that this was a mistake, and should be fixed. If anything, P1102 was Janitorial work.

P1048 looks like an actual useful thing by a long-term member of the committee.

P2324 is a little silly, but Martin has been doing some things in WG14 with some attempt to 'clean up' the C language (for better or worse), so this paper was to bring the same change to C++ (likely at the insistence of certain WG14 members).

P3142: Another established member of the committee who doesn't really need 'resume padding'. This is something that he came across and bothered him so he wrote a paper.

P2360: Calling ANYTHING Jens does as 'resume padding' invalidates your entire argument. Jen is one of the most pedantic people ever (hence why he's chair of CWG!), and his resume doesn't need padding.

Honestly, we DO get 'resume padding' papers, but rarely do they ever make it anywhere in committee. If they do, it is because it is a good idea that improves the language.

-1

u/pp-collision 19d ago

I appreciate the detailed answer, I tried finding examples, I just skimmed some and picked them (I don't feel like spending the entire day on finding examples), and you were able to argue that each one was reasonable, just like the authors were, and just like I said that one could.

I would have to dig more to try to find examples that you could then try arguing for as well, but that's a waste of time. What about the WG21 study that exactly proves my point "WG21 Game Theory: The Culture That Emerges From SD-4" https://open-std.org/JTC1/SC22/WG21/docs/papers/2026/p4195r1.pdf

8

u/erichkeane 19d ago

I wasn't necessarily saying they were 'reasonable', just that they weren't the accusation of 'resume building'. They all clearly were not.

As far as P4195: Based on my position I cannot comment on that one the way I would like, but :

1- That isn't a 'WG21' study. It is a single individual who had his employee sign it too. 2- I'm not sure it qualifies as a 'study', or if it does, we've destroyed the word 'study'. IT is an AI analysis of 'partial' information that reached the conclusion the person using the AI wanted it to. 3- You make yourself seem way less serious/intelligent to reference that author.

1

u/pp-collision 19d ago

It's not a study, forgive me for not being precise in my terminology on this academic forum. You attack the use of AI and not the content though, you think the author is not serious? Quite a lot of ad-hominem and judgment, not sure why, perhaps I struck a nerve?

How did the C++ standard become so bloated then, if the committee votes down all resume padding proposals that are not genuinely good proposals?

6

u/erichkeane 19d ago

It's not a study, forgive me for not being precise in my terminology on this academic forum. You attack the use of AI and not the content though, you think the author is not serious? Quite a lot of ad-hominem and judgment, not sure why, perhaps I struck a nerve?

Weird thing to say. I've not the room nor time to go over the various reasons why this is not a paper taken seriously.

How did the C++ standard become so bloated then,

This is a subjective statement first of all. Many complain about C++'s LACK of features too. While there are definitely features that aren't useful to everyone, I strongly believe just about everything that has been standardized is useful to a significant subset of the language's users.

Perhaps at times the evolution groups are less good at saying 'no' than they should be, but the motivations of most successful authors is "I believe this is generally useful and think others do too!", not "I hope this helps me get a job". Most folks on the committee already have really solid jobs and don't need the help.

11

u/ericonr 19d ago

lol, with P1102R2 I'd go further and bemoan the loss of consistency. Functions have parentheses to declare their parameters or lack thereof, saving some typing makes no sense.

8

u/pp-collision 19d ago

Yes I agree with that, it's absolute nonsense which is why I would also never use it, and I would ban it in a style guide.

4

u/erichkeane 19d ago

P1102 FIXED a consistency. Lambdas already allowed omitting the parens by the original proposal. P1102 makes it so that it applies to mutable lambdas as well, which was an inconsistency in the grammar.

4

u/ericonr 19d ago

Fair enough. We can all agree that the original paper introducing this spec was the issue, then.

5

u/TheoreticalDumbass 19d ago

... i use this all the time

5

u/IndependentOk9134 19d ago

isnt most of the actual bloat coming from the design by committee process over the last twenty years rather than Bjarne himself though