www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Herb Sutter is planning to reduce C++'s complexity

reply Per =?UTF-8?B?Tm9yZGzDtnc=?= <per.nordlow gmail.com> writes:
At [1] Herb Sutter outlines his plans for simplifying C++'s 
complexity. Good that they realize the importance of this.

Specifically there's a plan to copy the meaning of D's parameter 
qualifiers `in`, `out` and `inout` (`ref` in D).

At 17:51 in [2], he interestingly mentions the rules for passing 
`in` parameters where passing-type should be inferred just like 
the newest update of `-preview=in` does.

He also mentions more inference of pass-by-move similar to what 
Walter has proposed at [3]

[1] ”Empirically Measuring, & Reducing, C++’s Accidental 
Complexity - Herb Sutter - CppCon 2020” på YouTube: 
https://youtu.be/6lurOCdaj0Y

[2] https://youtu.be/6lurOCdaj0Y?t=1071

[3] "Copying, Moving, and Forwarding": 
https://github.com/dlang/DIPs/blob/ed106bfb4a332d77df3288054006062a4e2a0e3e/DIPs/13NNN-WGB.md
Oct 11 2020
parent claptrap <clap trap.com> writes:
On Sunday, 11 October 2020 at 11:46:36 UTC, Per Nordlöw wrote:
 At [1] Herb Sutter outlines his plans for simplifying C++'s 
 complexity. Good that they realize the importance of this.

 Specifically there's a plan to copy the meaning of D's 
 parameter qualifiers `in`, `out` and `inout` (`ref` in D).

 At 17:51 in [2], he interestingly mentions the rules for 
 passing `in` parameters where passing-type should be inferred 
 just like the newest update of `-preview=in` does.

 He also mentions more inference of pass-by-move similar to what 
 Walter has proposed at [3]
I think it's a pretty interesting way to measure complexity by counting how many guidelines there are for the feature. I guess it's sort of a more empirical version of Andrei's can you explain it in 30 seconds rule. Maybe a similar kind of metric could be applied to D features, explain the feature and account for all the corner cases, and see how much text you have. It's also interesting that it seems pretty much accepted that the only way to simplify C++ is to add new things that allow ghosting of old wonky things. Even if it takes 10 to 15 years to happen. Its seems some feel D has gotten towards the large and unwieldy end of the design space, but adding more stuff is not the way forward. I wonder how else you can simplify but by replacing old with new. (Even if the old has to hang around in limbo.) Also after watching the video and skimming the pdf there seems to be no mention of aliasing with 'in' parameters as was recently discussed in the newsgroup. I wonder if they/he just hasn't considered it or they dont think it's something to be concerned about, or maybe it's just not solvable and the net gain from simplifying parameter passing is worth that unlikely corner case. https://github.com/hsutter/708/blob/main/708.pdf
Oct 13 2020